I have a script in the current directory, however, given that:
- the permission is
-rwxr-xr-x
- the script has a shebang
#!/bin/bash
at the top of the file - my shell is
/bin/bash
- I can execute it using
bash script.sh
I cannot execute it using ./script.sh
. It gives me:
bash: ./script.sh: Permission denied
Why is this happening and what is the solution?