[Semibug] ksh select command

Anthony Cascianelli acascianelli at icloud.com
Thu Jan 28 21:06:42 EST 2021


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
>      break
> done
> 
> gives this output:
> 
> 1) apple
> 2) boy
> 3) cat
> 4) dog
> Pick one ->3
> cat
> 
> 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?
> 
> Nick.
> 
> _______________________________________________
> Semibug mailing list
> Semibug at lists.nycbug.org
> http://lists.nycbug.org:8080/mailman/listinfo/semibug



More information about the Semibug mailing list