Question: 1. Write a shell script to prompt the user for a variable, test the value of the variable, if it = 1 then write to

1. Write a shell script to prompt the user for a variable, test the value of the variable, if it = 1 then write to the screen, "The value was 1", else write to the screen "The value was not 1".

2.Write a shell script program that accepts three parameters and displays their average to the user. Note: you will probably have to do two calculations, one for the total and one for the division.

3.Write a shell script program that accepts a variable number of parameters and displays their average, and the number of numbers input, to the user.

4.Write a shell script program that accepts a file name from the user, displays the file to you using the less command, then calls the editor (command isgeany) to allow you to edit that file, once you quit the text editor, your shell script will continue to run. It should then display the file using the lesscommand again. Make some changes in the text editor so you can see that the file has changed. Do not forget to test if the file exists before you attempt to do anything with it. If it does not exist then output an appropriate error message.

5.Write a shell script program to provide the following facilities to a user in the form of a menu: Allow the user to use an editor e.g. geany (which can be called from the command line using geany filename) to write a poem. Run a word count on your poem using wc Display the output to the screen and display a page at a time using more or less (ask the user which one they want to use). Sort the output using the UNIX sort command and put the results into a file, then display the output of the sorted file using cat or more. (ask the user which one they want to use) Exit

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!