LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Plaese help Simple Linux Script help with VI (https://www.linuxquestions.org/questions/programming-9/plaese-help-simple-linux-script-help-with-vi-687482/)

ZarTheMad 12-01-2008 10:39 AM

Plaese help Simple Linux Script help with VI
 
I been working on this forever can you please can you show what it would look like in VI all the lines. I so apperciate.

This is for Linux and im using Bash with VI editor



Create a filewith a name.

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




Write a shell script to implement the menu above.

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.

unSpawn 12-01-2008 11:38 AM

Hello and welcoem to LQ. You're obviously new here so you probably didn't take the time to read the LQ Rules yet.

Quote:

Originally Posted by ZarTheMad (Post 3360621)
I been working on this forever

Asking for homework handouts is frowned upon because you'll learn nothing. Instead of asking broad questions try asking how to fix one specific thing then move on to the next. And please do post your (pseudo)code.


All times are GMT -5. The time now is 11:42 PM.