03-17-2009
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
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hello all
im trying to use in sun Solaris the information received from the top command
now i several machines that dont have install the top program so when im running the script im geting error
saying after im running this code :
set MemoryInfo = `top | grep Memory`
if (... (2 Replies)
Discussion started by: umen
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,All
I wrote below script(Example1.sh) and i ran but it giveing error. it's excuted yesterday.
SYSTEM_TIME=`date '+%H:%M:%S'`
CMP_LOG_TIME=`head -1 runcmp-HINET.log`
CMP_ENDED1=`grep 'HINET CMP ended' runcmp-HINET.log`
CMP_ENDED2=`echo "HINET CMP ended"`
CMP_FAILED2=`echo "HINET... (2 Replies)
Discussion started by: koti_rama
2 Replies
3. Shell Programming and Scripting
Hi,All
I wrote below script(Example1.sh) and i ran but i got error. it's excuted yesterday.
SYSTEM_TIME=`date '+%H:%M:%S'`
CMP_LOG_TIME=`head -1 runcmp-HINET.log`
CMP_ENDED1=`grep 'HINET CMP ended' runcmp-HINET.log`
CMP_ENDED2=`echo "HINET CMP ended"`
CMP_FAILED2=`echo "HINET CMP... (2 Replies)
Discussion started by: koti_rama
2 Replies
4. Shell Programming and Scripting
The purpose of those comands are to find the newest file in a directory acvrdind to system date, and it has to be recursively found in each directory.
The problem is that i want to list in a long format every found file, but the commands i use produce unexpected results ,so the output lists in a... (5 Replies)
Discussion started by: alexcol
5 Replies
5. UNIX for Dummies Questions & Answers
Hi again
I have the follwing - cat ~/ABCFILE | grep "$SYSTEM" | grep "$USERNAME"
What I'm looking to do is have the variable for $SYSTEM determined by the user making a selection from a numbered list. So, input 1 would be system ABC etc.
I'm very puzzled as to how to go about this?
Any... (3 Replies)
Discussion started by: Great Uncle Kip
3 Replies
6. Shell Programming and Scripting
when the file is not found i want it to return to the menu, however it carries out the next line when i hit a key
I know its probably something simple can anyone help?
here is my pause function:
function pause(){
read -s -n 1 -p "Press any key to return to Menu . . ."
echo
}
SCRIPT... (2 Replies)
Discussion started by: Alendrin
2 Replies
7. UNIX for Dummies Questions & Answers
I get a "command not found" error when I run the csh command. I also get this error when I start a new session since my default shell is c shell. Any pointers as to what is going on?
I am trying to set some paths using the .cshrc file and need to use the csh command for this.
Thanks. (1 Reply)
Discussion started by: kannyg
1 Replies
8. Shell Programming and Scripting
I am trying to find the number of files whose name starts with uni.
Below is the code but it is giving error. :confused:
#!/bin/csh
FILES_NAME ='files_list';
FILE_NAME_PATTERN = 'uni*';
NO_OF_FILES;
ls -l $FILE_NAME_PATTERN > $FILES_NAME ;
NO_OF_FILES = `wc -l $FILES_NAME`;
echo... (3 Replies)
Discussion started by: hiten.r.chauhan
3 Replies
9. Shell Programming and Scripting
hi all i am a newbie to this
is there any examples on creating a main menu with 3 sub menu
main menu -> option a , b and c
a menu -> option 1 ,2 and 3
b menu -> option 1 ,2
c menu -> option 1 ,2
i am getting headache as my code kept getting unexpected EOF
---------- Post... (0 Replies)
Discussion started by: chercm
0 Replies
LEARN ABOUT DEBIAN
install-menu
install-menu(1) Debian GNU/Linux manual install-menu(1)
NAME
install-menu - Process a menu method and generate the menu files for a window manager or a menu-aware application.
DESCRIPTION
update-menus(1) computes the list of menu entries and passes it in turn to the menu methods in /etc/menu-methods/. The task of a menu meth-
ods is to generate menus for a specific window manager. install-menu provides a generic and customizable way to do that. The documentation
of the install-menu definition language is available in the Debian Menu manual, a local copy being available in /usr/share/doc/menu/html.
SYNOPSIS
install-menu [-vh] [--remove] <menu-method>
Read menu entries from stdin in update-menus --stdout format and generate menu files using the specified menu-method.
Normally used in menu method scripts as #! /usr/bin/install-menu.
OPTIONS
-h,--help
Show the help message and exit.
--remove
Remove the menu files instead of generating them.
-v,--verbose
Output messages about what the program is doing.
COPYING
install-menu is distributed under the term of the GNU General Public License version 2, or (at your option) any later version.
AUTHOR
Written by Joost Witteveen <joostje@debian.org>. Now maintained by Bill Allombert <ballombe@debian.org>.
SEE ALSO
update-menus(1), menufile(5), /usr/share/doc/menu/html
Debian Project 28 November 2005 install-menu(1)