Compare case terminators

A dispatch script uses the following template in Bash 4 or later. Run it independently for each terminator shown in the table, replacing only END_FIRST. Each run starts with all counters at zero. Enter the final counter values as exact integers.


Shell
queued=0
archived=0
verified=0

case report in
    report)
        (( queued += 1 ))
        END_FIRST
    archive)
        (( archived += 1 ))
        ;;
    report)
        (( verified += 1 ))
        ;;
esac
First terminatorqueuedarchivedverified
;;
;&
;;&

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Bash Control Structures Questions: