![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Scripting problem - when the file is not found i want it to return to the menu | Alendrin | Shell Programming and Scripting | 2 | 03-04-2009 01:25 PM |
| Using a list menu as a variable | Great Uncle Kip | UNIX for Dummies Questions & Answers | 3 | 01-22-2009 11:41 AM |
| Help with find command and list in a long format each found file | alexcol | Shell Programming and Scripting | 5 | 12-10-2007 08:59 AM |
| Ambiguous and Command not found Error in UNIX | koti_rama | Shell Programming and Scripting | 2 | 07-13-2007 10:42 AM |
| Ambiguous and Command not found Error in UNIX | koti_rama | UNIX for Dummies Questions & Answers | 2 | 07-12-2007 09:44 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Menu list in Unix csh - command not found
Hello, im taking a class of Unix and i dont really know much about it, im trying to create a list of menu a user would select from and im very lost. Basically it will have 5 options, the user will chose from:
1. list files in the pwd 2. display date and time 3. is the file file or directory 4. create a backup 5. exit I have no idea how to do options 3 and 4, i think i did right options 1.2.5. When I try to run the file (it has the x permission now) i am getting a command not found. Any idea how to finish it? Thanks !! This is what i have right now: #!bin/csh # This menu will allow user to select from a menu of options, and then perform the # selected command. User can use options until he chooses to exit while : do clear echo ***** Select from menu ***** echo "[1] List all files in the current directory" echo "[2] Display today's date and time" echo "[3] Display whether a file is just a file, or if it is a directory" echo "[4] Create a back up file" echo "[5] Exit the menu" echo -n "Select your choice {1-5}:" read yourch case $yourch in 1) echo "These are your files: "; ls -l; echo "Press Enter"; read;; 2) echo "Today is 'date', time is 'time'; echo "Press Enter"; read;; 5) exit 0 ;; "menunix" 21 lines, 652 characters |
|
||||
|
Thanks ! I tried to something but it's still not working, still getting Command not found error:
#!bin/csh # This menu will allow user to select from a menu of options, and then perform the # selected command. User can use options until he chooses to exit while : do clear echo ***** Select from menu ***** echo "[1] List all files in the current directory" echo "[2] Display today's date and time" echo "[3] Display whether a file is just a file, or if it is a directory" echo "[4] Create a back up file" echo "[5] Exit the menu" echo -n "Select your choice {1-5}:" read yourch case $yourch in 1) echo "These are your files: "; ls -l; echo "Press Enter"; read;; 2) echo "Today is 'date', time is 'time'; echo "Press Enter"; read;; 3) echo "Is the file a file or a directory?"; -a $1; echo "File is a file, not a directory"; read;; 4) echo "Create a backfile"; mv $; echo "Press Enter"; read;; 5) exit 0 ;; |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|