Bird
0
0

You have a script deploy.sh that you want to run directly by typing ./deploy.sh. However, it still says "Permission denied" after chmod +x deploy.sh. What could be the reason?

hard🚀 Application Q15 of 15
Bash Scripting - Basics
You have a script deploy.sh that you want to run directly by typing ./deploy.sh. However, it still says "Permission denied" after chmod +x deploy.sh. What could be the reason?
AThe script is on a mounted filesystem that does not support execute permissions.
BYou forgot to add read permission with <code>chmod +r deploy.sh</code>.
CYou need to rename the script to <code>deploy.exe</code>.
DYou must run the script with <code>bash deploy.sh</code> instead of <code>./deploy.sh</code>.
Step-by-Step Solution
Solution:
  1. Step 1: Confirm execute permission is set

    Since chmod +x deploy.sh was run, the script should have execute permission.
  2. Step 2: Consider filesystem limitations

    Some mounted filesystems (like FAT32 or network shares) do not support Unix execute permissions, causing "Permission denied" despite chmod +x.
  3. Step 3: Evaluate other options

    Adding read permission is usually default; renaming to .exe is irrelevant in Linux; running with bash works but does not explain the permission error when running ./deploy.sh.
  4. Final Answer:

    The script is on a mounted filesystem that does not support execute permissions. -> Option A
  5. Quick Check:

    Filesystem may block execute permission despite chmod [OK]
Quick Trick: Check if filesystem supports execute permissions [OK]
Common Mistakes:
MISTAKES
  • Assuming chmod always works on all filesystems
  • Thinking read permission alone allows execution
  • Confusing script name extension with execution ability

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes