Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write three bash shell scripts that say Hello. The first script should be named 04- hello-1, the second, 04-hello-2, and the third, 04-hello-3. All three

Write three bash shell scripts that say Hello. The first script should be named 04- hello-1, the second, 04-hello-2, and the third, 04-hello-3. All three will also tell the current date. See the example runs below for clarification on how these scripts should work. (Note that the $ is the Linux prompt, not part of the command you type.)

i. Hello-1 should simply say hello when it runs, and list the current date. The date can be in any format. It does nothing with command-line parameters.

ii. Hello-2 should say hello to the name specified in a single command-line parameter, but does not need to do any command-line error-checking. It should display only the month, day of the month, and the year, for the date (not anything else), in the format illustrated below.

iii. Hello-3 should work just like Hello-2 does, except that there should be a comma between the day of the month, and the year, and it should check to make sure that a single command-line parameter is used, and, if not, an appropriate error/help-message is displayed.

$ 04-hello-1 #correct input

Hello! Today is Sun Apr 09 14:42:59 MDT 2017

$ 04-hello-2 Sally #correct input (no error checking)

Hello, Sally! Today is 09 Apr 2017.

$ 04-hello-3 #incorrect input (no name) with error checking

USAGE: 04-hello-3 Where is the name of the person running the script. Ex: hello-3 Sally

$ 04-hello-3 Sally #correct input

Hello, Sally! Today is 09 Apr, of 2017.

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 Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions

Question

What is the mean world syndrome?

Answered: 1 week ago

Question

Write Hund's rule?

Answered: 1 week ago

Question

13-4 What are alternative methods for building information systems?

Answered: 1 week ago