[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: select: want to let user leave with just a RET

From: Aharon Robbins
Subject: Re: select: want to let user leave with just a RET
Date: Sun, 30 Jun 2002 09:11:09 GMT

In article <address@hidden>,
Dan Jacobson <address@hidden> wrote:
>>> The only thing bugging me about this is that I want to let the user go
>>> if he enters just a RET.  Apparently this is not possible.  Perhaps a
>>> "select -e" should be added so the user can get out with just a RET
>>> instead of fancy C-d, C-c.
>I ran Arnold's example on debian woody and I hit just plain RET and it wouldn't
>let me go.  Had to hit C-d.
>select var in word1 word2 
>       if [ "$REPLY" = "" ]
>       then
>               echo congratulations, Dan Jacobson is very curious how \
>               you got here
>               break
>       fi
>       echo $var

Yep, I blew it. I apologize.

The definition of the way select works is that it reprints the menu
when a return is entered.  Best you can do is something like:

        PS3='Use ctrl-d to exit or enter choice: '

I should have put my brain in gear before posting.

Aharon (Arnold) Robbins --- Pioneer Consulting Ltd.     address@hidden
P.O. Box 354            Home Phone: +972  8 979-0381    Fax: +1 928 569 9018
Nof Ayalon              Cell Phone: +972 51  297-545
D.N. Shimshon 99785     ISRAEL

reply via email to

[Prev in Thread] Current Thread [Next in Thread]