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
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started