Question: In Unix/linux Write 3 scripts, all doing the same thing in different ways. (Perhaps call it greetinga, greetingb, etc?) that will echo the appropriate greeting

In Unix/linux Write 3 scripts, all doing the same thing in different ways. (Perhaps call it greetinga, "greetingb", etc?) that will echo the appropriate greeting Good Morning, Good Afternoon or Good Evening, depending on what time it is. There should be 3 versions: a. Give your script the current hour as a command-line parameter (in 24-hour format) (What does parameter mean?? The hour goes on the command line, when you call the script. NOT with "read" inside the script!) b. Pipe the output of the date command to the script (which means your need to use the "read" command to get the output of "date"). c. Use the date command inside the script to find the current hour. (Use man to find out how to get just the hour from the date command.) Which of these three methods of getting input do you think is most convenient for the user of the script? (Note that "as a parameter" means the user puts the time on the command line, and the script uses the built-in variables to process it. If the input is piped to the command, it comes in as standard input, which is read with the "read" command.) 3. Write a script that will print out the largest of 3 numbers you give as parameters to the script. (Again, as parameters, not as standard input.) 4. Write a script that will ask the user for a name or account, and then look that name or account in /etc/passwd and print out the corresponding home directory. Put out an error message if the name is not found. (Dont forget case, and that there may be more than one of a name in the password file, so you have to make sure the name typed in is the whole account name, or if it is a user name, that all the ansers come out nicely.)

Please explain the solutions with examples and make it readable or typed. Thankyou.

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!