Post a New Question

operating system

posted by on .

I been working on this forever can you please show fully how to create these 2 small scripts. It would be very appreciated! the editor im using is VI

1. Write a script called to do the following:

Displays "There are no arguments" if no arguments were entered.
Displays "There are n arguments" if arguments were entered where n is the number of arguments.
Displays "The arguments are a, b, c" when arguments are entered and a, b, c are agrument1, argument2 etc.


a. Current date and time
b. Users currently logged in
c. Number of users logged in
d. Contents of current directory

Enter Choice..........

2. Write a shell script to implement the menu above. Call the script

Execute the appropriate commands only when the user enters one of the menu choices. Display an error message such as "invalid choice" if the choice is not a, b,c, or d.
Remember that the read statement followed by a variable name will obtain input from the user.

Use the case structure to evaluate the choice entered.

1. Make both scripts executable.
2. Start the script command with lab8.txt as the file name.
3. Display the contents of the script in 1 above with cat
4. Display the contens of with cat.
5. Run with no arguments
6. Run with three arguments
7. Run four times. first time select choice a, etc.
8. Run and enter choice x

Answer This Question

First Name:
School Subject:

Related Questions

More Related Questions

Post a New Question