Computer scienceSystem administration and DevOpsCommand lineBash syntax

Case statement and argument parsing

Case

Report a typo

Create a function that prints the following lines based on arguments provided during execution.

  • "G" or "g" -> "The defendant is guilty."
  • "N" or "n" -> "The defendant is not guilty."
  • "P" or "p" -> "The trial has been postponed."
  • Any other string -> "Order Order!"

Sample Input 1:

Sample Output 1:

The defendant is guilty.
The defendant is not guilty.
The trial has been postponed.
Order Order!
The trial has been postponed.
Write a program in Shell
#!/usr/bin/env bash
function court() {
# put your code here
}
___

Create a free account to access the full topic