bash: ./filename: Permission Denied
Hello all i have this problem after i successfully compiled main.cpp with clang as per the screenshot below.
I have done termux-setup-storage, and as you can also see placed the .cpp file in com.termux/files/home. (In my internal storage, my tablet don't support Sdcard)
You can also see the .stat of filename.
4 Replies
internal storage doesnt support execution, move your stuff to
/data/data/com.termux/files/home/
or ~
for short
also read this for how to edit files in there:
!tag saf
bot dedchmod +x filename
Then try running it
!tag saf
I know it's kinda weird thar I am replying after 3/4 months but whatever I just wanted to give you a quick solution. but first, I am assuming you know how to use a text editor in termux. if you don't, you may check a tutorial or something then read the rest of this comment.
#!bin@fish said that you need to do it in the termux home file, but let's be realistic we all wanna run bash in the coding folder we made (whether it's in the internal storage or sd card)
so, the best way to do it is by adding a command "run" that runs your little script no matter where it is.
So, do the following:
this will open the bash.bashrc, which runs commands automatically the moment you open termux, in a text editor called nano. Termux has this text editor pre-installed afak but if you have another text editor you may also use it.
after you open it, go to the bottom and add the following new commands:
this will add 2 new commands you may use.
bedit
Use it to open the bash.bashrc file in nano.
run
use it to fix your issue
or
or
----
also,
if you don't want to use nano in bedit just replace the "nano" in the beginning of the code I gave you with your desired text editor