Bird
0
0

Which of the following is the correct syntax to run a bash script named backup.sh without changing its permissions?

easy📝 Syntax Q12 of 15
Bash Scripting - Basics
Which of the following is the correct syntax to run a bash script named backup.sh without changing its permissions?
A<code>./backup.sh</code>
B<code>sh run backup.sh</code>
C<code>bash backup.sh</code>
D<code>execute backup.sh</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand running scripts without execute permission

    If the script is not executable, you can run it by explicitly calling the shell interpreter like bash backup.sh.
  2. Step 2: Identify correct syntax

    bash backup.sh runs the script using bash without needing execute permission. Other options either require execute permission or are invalid commands.
  3. Final Answer:

    bash backup.sh -> Option C
  4. Quick Check:

    Run script with interpreter command = B [OK]
Quick Trick: Use bash script.sh to run without execute permission [OK]
Common Mistakes:
MISTAKES
  • Trying to run with ./ without execute permission
  • Using invalid commands like execute
  • Adding extra words like 'run' before script name

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes