[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: |
Wed, 26 Jun 2002 08:52:18 GMT |
In article <87vg885kjg.fsf@jidanni.org>,
Dan Jacobson <jidanni@dman.ddts.net> wrote:
>select: select NAME [in WORDS ... ;] do COMMANDS; done
> ...to that word. If the line is empty, WORDS and the prompt are
> redisplayed. If EOF is read, the command completes...
>
>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.
Yet another amazing point from the "Unix Black Belt".
Ahem:
select var in word1 word2
do
if [ "$REPLY" = "" ]
then
break
fi
....
done
'nuff said.
--
Aharon (Arnold) Robbins --- Pioneer Consulting Ltd. arnold@skeeve.com
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