Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

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

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

978-0764535376

More Books

Students explore these related Databases questions