Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This lab is asking you to use get opts commend/program to process command-line options passed to your script. What you should do: 1- Write a

image text in transcribed
This lab is asking you to use get opts commend/program to process command-line options passed to your script. What you should do: 1- Write a bash script that checks if options a, b, c. and 2 where used by the user when your script was Invoked (called), where option a and d must take arguments 2- Your script should generate (handle) error messages 3- Your script should display to the screen (terminal) information which, if any. option was triggered or feedback to the user (me) that the user (I) tried to invoke invalid (unexpected) option or an error message If the right option was used by the user (me) but it expects argument that was not provided Some examples on how your script should behave If I run your script by typing: ./Lab_9_YourName. sh -b It should display Option -b- was triggered If I run your script by typing: ./Lab_9_YourName. sh -a a. argument it should display: Option -a- was triggered with argument: a_argument If I run your script by typing: ./Lab_ 9_YourName. sh -d It should display: Option -d- expects its argument that was not provided If I run your script by typing: ./Lab 9_YourName .sh -c it should display invalid option -e- The valid options are -a-, -b- -c-. and -e- where options -a- and -d- must be followed by an argument If I run your script by typing: ./Lab..9. YousName .sh it should display: No options were triggered This lab is asking you to use get opts commend/program to process command-line options passed to your script. What you should do: 1- Write a bash script that checks if options a, b, c. and 2 where used by the user when your script was Invoked (called), where option a and d must take arguments 2- Your script should generate (handle) error messages 3- Your script should display to the screen (terminal) information which, if any. option was triggered or feedback to the user (me) that the user (I) tried to invoke invalid (unexpected) option or an error message If the right option was used by the user (me) but it expects argument that was not provided Some examples on how your script should behave If I run your script by typing: ./Lab_9_YourName. sh -b It should display Option -b- was triggered If I run your script by typing: ./Lab_9_YourName. sh -a a. argument it should display: Option -a- was triggered with argument: a_argument If I run your script by typing: ./Lab_ 9_YourName. sh -d It should display: Option -d- expects its argument that was not provided If I run your script by typing: ./Lab 9_YourName .sh -c it should display invalid option -e- The valid options are -a-, -b- -c-. and -e- where options -a- and -d- must be followed by an argument If I run your script by typing: ./Lab..9. YousName .sh it should display: No options were triggered

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

Step: 3

blur-text-image

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago