Question: Write a script that lists all the zip codes of a specific city or state. It takes in three possible flags. The -c flag takes

Write a script that lists all the zip codes of a specific city or state. It takes in three possible flags.

The -c flag takes a CITY argument, which specifies the city to search for within the STATE. If no CITY is specified, then the script should return all the zip codes in the STATE.

The -s flag takes a STATE argument, which specifies the STATE to search through. If no STATE is specified, then the script should assume the STATE is "Indiana".

The -h flag will display the usage message and exit with success.

If no city is specified, then list all the zip codes in the state.

Here is a skeleton:

#!/bin/sh # Globals URL=https://www.zipcodestogo.com/ # Functions usage() { } # Parse Command Line Options while [ $# -gt 0 ]; do case $1 in -h) usage 0;; *) usage 1;; esac shift done # Filter Pipeline(s) curl -s $URL

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!