![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A little guidance needed :) | shadow0001 | Shell Programming and Scripting | 9 | 03-07-2008 10:16 AM |
| Career Guidance | sufi_431 | What's on Your Mind? | 1 | 10-23-2007 07:54 AM |
| NIM Guidance | scottsl | AIX | 1 | 06-12-2006 08:18 AM |
| Drop down menu in bash for timezone select | simonb | Shell Programming and Scripting | 1 | 04-29-2006 10:02 AM |
| Looking for guidance in obtaining a job in Unix Administration | pkali290 | SCO | 4 | 12-08-2003 11:51 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
select in ksh, any guidance for bash?
I have a file driven menu using the select feature in ksh. I like doing it this way, however I would prefer running a bash. Is there some eqivalent way of doing this in a bash shell?
ie select file in *.ascii do typeset -u REPLY if [ $REPLY = "Q" ] ; then break fi if [ ! -f ${file}.type ] ; then perl $ENVIRON/$CLIENT/code/addtype.pl $file ${file}.type if [ ! -f ${file}.type ] ; then print "\nProgram E rror!\n" break fi fi type=${file}.type process break done Guidance and/or ideas are much appreciated. |
| Forum Sponsor | ||
|
|
|
|||
|
According to the man page on bash it uses select also.
User Commands BASH(1) select name [ in word ] ; do list ; done The list of words following in is expanded, generating a list of items. The set of expanded words is printed on the standard error, each preceded by a number. If the in word is omitted, the positional parameters are printed (see PARAMETERS below). The PS3 prompt is then displayed and a line read from the standard input. If the line consists of a number corresponding to one of the displayed words, then the value of name is set to that word. If the line is empty, the words and prompt are displayed again. If EOF is read, the command com- pletes. Any other value read causes name to be set to null. The line read is saved in the variable REPLY. The list is executed after each selection until a break or return command is executed. The exit status of select is the exit status of the last command executed in list, or zero if no commands were executed. |
|||
| Google UNIX.COM |