← All topics
Quiz: Bash Scripting for DevOps: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What exit code means a command succeeded?
- Q2. In npm test && npm run build, when does the build run?
- Q3. Which line correctly creates a variable in bash?
- Q4. A variable file holds exam marks.txt. Why is rm "$file" safer than rm $file?
- Q5. What does set -e do in a script?
- Q6. Why is set -o pipefail useful?
- Q7. What does the cron line 30 2 1-5 /home/deploy/backup.sh mean?
- Q8. What does this print? (code)
- Q9. The health-check script prints "ALERT" and then runs exit 1. Why does the exit code matter?
- Q10. A cron job works when you run it by hand but does nothing from cron. What is a likely cause?