Post a New Question

operating system

posted by .

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 simple.sh 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.







Menu

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 menu.sh

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 simple.sh script in 1 above with cat
4. Display the contens of menu.sh with cat.
5. Run simple.sh with no arguments
6. Run simple.sh with three arguments
7. Run menu.sh four times. first time select choice a, etc.
8. Run menu.sh and enter choice x

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. programming

    can someone write this script with unix The script should be named final_YourLastname (e.g., a script written by York should be named: final_York). The script should implement car rental reservation activities. The main menu of the …
  2. Socials Studies (URGENT)

    I need to create a children's book of at least 15 pages. I must write about Jacques Cartier, Samuel de Champlain or what life was like in New France. I was going to do Jacques Cartier, but it was too hard. I didn't know how to do it. …
  3. research&writing

    Due Week 2 and worth 100 points Your sister owns a small clothing store. During a conversation at a family dinner, she mentions her frustration with having to manually track and reorder high demand items. She would like an automated …
  4. computers

    Your sister owns a small clothing store. During a conversation at a family dinner, she mentions her frustration with having to manually track and reorder high demand items. She would like an automated system but has a very small budget. …
  5. computers

    I need some help with creating a simple, but automatic site status (uptime/downtime) monitor script in ColdFusion. Basically I would like the script to check if an application on my site is accessible or not every 60 minutes. If the …
  6. Computers

    Your sister owns a small clothing store. During a conversation at a family dinner, she mentions her frustration with having to manually track and reorder high demand items. She would like an automated system but has a very small budget. …
  7. Computers

    Your sister owns a small clothing store. During a conversation at a family dinner, she mentions her frustration with having to manually track and reorder high demand items. She would like an automated system but has a very small budget. …
  8. Computers

    Your sister owns a small clothing store. During a conversation at a family dinner, she mentions her frustration with having to manually track and reorder high demand items. She would like an automated system but has a very small budget. …
  9. CIS 210

    Your sister owns a small clothing store. During a conversation at a family dinner, she mentions her frustration with having to manually track and reorder high demand items. She would like an automated system but has a very small budget. …
  10. Principle of Marketing

    Requirement 3: Television or Radio Advertisement (20 Points) For this requirement, each team will create a storyboard or script for a television or radio advertisement. An average radio or television ad is about 30 seconds, so have …

More Similar Questions

Post a New Question