Bash Shell Scripting Fundamentals

By Devin Park · Updated May 25, 2026

Questions23
Passing Score70%
Format65% Multiple Choice
Sessions Logged2,361
Your progressLog in / Register to track times taken, best score, questions mastered, and coverage on this quiz.
Rating
Community rating 4.6 out of 5 from 11 ratings.
4.6 (11)

Topics covered

This quiz

Uncategorized23 (100%)

Uncategorized23 questions

Question catalog for this preview

Catalog listing of the 5 preview questions for this quiz.

Question 1

In Bash, `[[blank1]] -eq 0` checks if a command succeeded (tests the exit code), and the construct `cmd1 [[blank2]] cmd2` executes cmd2 ONLY if cmd1 fails (non-zero exit code).

Question 2

In Bash, `$(command)` is used for [[blank1]], allowing the output of a command to be captured and used as a value in another command or variable assignment.

Question 3

In Bash, what is the difference between `$*` and `$@` when referencing all script arguments?

Answer choices

  • A. They are identical in all contexts

  • B. `$*` expands all arguments as a single word when quoted; `$@` expands each argument as a separate quoted word

  • C. `$*` holds the argument count; `$@` holds the argument values

  • D. `$@` is deprecated; `$*` is the current standard

Question 4

What is the purpose of the shebang line `#!/bin/bash` at the beginning of a shell script?

Answer choices

  • A. It is a comment explaining which shell to use

  • B. It tells the OS which interpreter to use to execute the script

  • C. It sets the bash version for compatibility

  • D. It grants execute permission to the script file

Question 5

The Bash command `[[blank1]] 0 23 * * 1-5 /opt/scripts/backup.sh` would schedule a cron job to run the backup script at 11 PM (23:00) on weekdays (Monday through Friday).