[Semibug] ksh select command
nick at holland-consulting.net
Fri Jan 29 08:24:38 EST 2021
Hah. Forgot Anthony was on this list. yes, he showed it to me.
I just violated the BSD principle of stealing everything but the credit! Oops!
On 1/28/21 9:06 PM, Anthony Cascianelli wrote:
> Thatâ€™s awesome! Who showed that this existed?
> Anthony Cascianelli
>> On Jan 28, 2021, at 8:48 PM, Nick Holland <nick at holland-consulting.net> wrote:
>> ï»¿Just gotta share...
>> Here's a ksh command I didn't know about until last week.
>> "select" -- a one-line menu command!
>> This code:
>> PS3="Pick one ->"
>> select Z in apple boy cat dog; do
>> echo $Z
>> gives this output:
>> 1) apple
>> 2) boy
>> 3) cat
>> 4) dog
>> Pick one ->3
>> Obviously, something other than "echo $Z" would go in the body.
>> PS3 sets the prompt.
>> So...did all the world except me know about this, or is this a new one for you?
>> Semibug mailing list
>> Semibug at lists.nycbug.org
More information about the Semibug