Defensive Shell Programming

Final Quiz

Connecting to LMS... Progress: in progress

Assessment

1. Why should shell scripts be treated as real operational software?
2. What does quoting a shell variable usually help preserve?
3. Why can unquoted variables be risky?
4. Which input sources should defensive scripts treat carefully?
5. What is a good way to validate a script mode such as backup, verify, or status?
6. Why is it important to check command results?
7. What is a limitation of strict mode options such as set -e?
8. Why should scripts use safe temporary-file patterns?
9. What is one risk of putting secrets in command-line arguments?
10. What is a good logging practice for defensive shell scripts?
11. Why is a dry-run mode useful?
12. What is the main goal of defensive shell programming?