Linux Essentials (010-160) — Question 25

The current directory contains the following file:
-rw-r`"r`" 1 root exec 24551 Apr 2 12:36 test.sh
The file contains a valid shell script, but executing this file using ./test.sh leads to this error: bash: ./test.sh: Permission denied
What should be done in order to successfully execute the script?

Answer options

Correct answer: B

Explanation

The correct answer is B because the error indicates that the file does not have execute permissions set for the user. Changing the file extension or modifying group membership will not resolve the permission issue. Setting the SetUID bit is not necessary in this case, and the shebang line is not relevant to executing the script directly.