Linux Operating System (MOSC)

MOSC Banner

Cannot execute a shell script though permissions are set correctly

edited Jun 3, 2023 1:12AM in Linux Operating System (MOSC) 5 commentsAnswered ✓

We just migrated our servers from RHEL 7 to RHEL 8. Now the shell scripts that were working fine under RHEL 7 by being called directly from the command prompt are not working on RHEL 8. The permissions on the script files are set properly.

Example:

$ ~/scripts$ ll yy.sh

-rwxr-xr-x. 1 oracle dba 20 May 31 08:32 yy.sh

$ ~/scripts$ ./yy.sh                     

-bash: ./yy.sh: Permission denied

$ ~/scripts$ cat yy.sh

echo testing script

When I put bash in front of the scripts it works. But on the RHEL 7 server I did not need to put bash in front of the scripts:

$ ~/scripts$ bash ./yy.sh

testing script

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center