What is the right way to start a bash script on Oracle Linux?
on a normal Linux server I use ./script.sh
But here is what I got when I do the same on Oracle Linux
[user@server ~]$ ./script.sh
bash: ./script.sh: Permission denied
The permissions are correct
[user@server ~]$ ll script.sh
-rwxr-x--x 1 user oraexpl 317 Jul 4 15:42 script.sh
It works ok if I omit the "/" character
[user@server ~]$ . script.sh
It works
It works ok if I execute it with bash
[user@server ~]$ bash script.sh
It works
In my script, I do have the Shebang /bin/bash
Is this behavior normal?
Thanks for your feedback
./script.sh, but your shell complains about./script_shell.sh. Please clarify if this is a typo, or ifscript.shinternally callsscript_shell.sh. – AdminBee Jul 04 '22 at 14:24noexec? – doneal24 Jul 04 '22 at 14:54noexec:-) – Artem S. Tashkinov Jul 04 '22 at 15:05/dev/mapper/vg_root-lv_home on /home type ext4 (rw,nosuid,nodev,noexec,relatime)
– Angel115 Jul 04 '22 at 17:04noexecon removable media (reasonable), on/dev/shm(also reasonable), and on/tmp(causes lots of problems, with podman, a few flexlm daemons, a few java apps, etc.). Doesn't call for the flag on/homeso I think you have an over-zealous admin or security group. – doneal24 Jul 04 '22 at 18:56findmnt --target .? (run in same dir as script) – ctrl-alt-delor Jul 04 '22 at 18:58