Question: 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

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!