Shell Scripting Basics

Evaluate understanding of simple Bash scripts and automation.

1. What is the correct shebang line to specify a bash shell script?
2. Which of the following are valid loop structures in shell scripting? (Select all that apply)
3. In shell scripting, variable assignment requires spaces around the '=' sign (e.g., var = 5).
4. What command is used to read user input from the terminal into a variable?
5. Which operator is used for arithmetic expansion in bash?
6. Which of the following are valid file test operators in shell scripting? (Select all that apply)
7. The exit status of a successful command in shell is 0.
8. What is the abbreviation for the Portable Operating System Interface standard that shell scripts often adhere to?
9. Which command is used to change the permissions of a file?
10. Which of the following are valid input/output redirection operators? (Select all that apply)
11. The 'case' statement in shell scripting is used for multiple conditional checks.
12. What symbol is used to comment a line in a shell script?
13. What does the '$?' variable represent in shell scripting?
14. Which of the following are valid arithmetic operators in bash? (Select all that apply)
15. Wildcards like '*' and '?' can be used in shell scripts to match filenames.
16. What command is used to display the current working directory?
17. Which loop is used to iterate over a list of items in shell scripting?
18. Which of the following are valid comparison operators for numeric values in shell conditionals? (Select all that apply)
19. Shell functions must be defined before they are called in a script.
20. What is the default shell for most Linux systems, often used for scripting?
Answered 0 of 0 — 0 correct