The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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

More UNIX and Linux Forum Topics You Might Find Helpful
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

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-08-2002
Shakey21
Guest
 

Posts: n/a
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
  #2 (permalink)  
Old 05-09-2002
thehoghunter
Guest
 

Posts: n/a
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
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:48 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0