I can't run my Bash script, execution permission is always denied.
I modified my files with command for example:
chmod u+x bash_script1.sh
and obtained the following after:
-rwxr--r-- 1 user group 1947 Jun 18 16:04 bash_script1.sh
-rwxr--r-- 1 user group 2430 Jun 18 15:59 bash_script2.sh
-rw-r--r-- 1 user group 1 Jun 18 10:57 runs.txt
However, I continue to get the following error when running from command line:
Comand:
./bash_script1.sh
Error:
-sh: ./bash_script1.sh: Permission denied
When I run the following command below, I don't get the error but I don't want to use bash to run my script:
bash bash_script1.sh
#!/usr/bin/env bash is placed at my heading.
user- are you actually logged in asuserwhen you try this? what is the output of theidcommand? what is the exact command that produces the error-sh: ./bash_script1.sh: Permission denied? – steeldriver Jun 18 '21 at 14:19./file_script1.shin command line. The output is as follows:uid=19979(user) gid=867800079(group) groups=867800079(group),11226(research),11765(omics)– Joe_Informatics Jun 18 '21 at 14:23noexecoption - check withfindmnt -T .(run from the directory that contains the script) – steeldriver Jun 18 '21 at 14:40/home /dev/md126p2 xfs rw,noexec,relatime,attr2,inode64,noquotathis is what I get after. How can I change this? or do I have to ask my sysadmin? – Joe_Informatics Jun 18 '21 at 14:54