Ask coding questions

← Back to all posts
.replit Run .sh File : Permission denied.
TalinSharma (77)

I am trying to configure my run button to run a .sh file. In the console it prints:
 ./run.sh
sh: 1: ./run.sh: Permission denied
exit status 126

This is my .replit file:
language = 'bash' run = './run.sh'

This is my run.sh file:
echo Hello World!

How should I fix this?

I found what the problem was!!! The file wasn't set as executable. I used

chmod +x run.sh
To fix it!

Thanks

Comments
hotnewtop
Mioun (20)

actually you don't need to do the command chmod +x run.sh, you just need to change run = './run.sh' to run = 'bash run.sh'

TalinSharma (77)

Oh. Ok! Thanks for the information! I will do the from now on. For now I will keep it as it is!

@Mioun