![]() You can also use file globbing if you are choosing among files: select file in *.tar. Note that the choices could be a simple list directly in the select statement like this: select opt in foo bar baz 'multi word choice'īut you can't put such a list in a scalar variable because of the spaces in one of the choices. Choice 8 1/2' x 11' Clear 2-View Single Pocket Heat-Sealed Menu Cover 1761pk8511hs From 0. The variable $opt contains the string from that index in the array. It is used as an index into the array as if the array were 1 based. You can see that $REPLY contains the string you entered at the prompt. If you choose it, it will output: you chose choice 3 which is Option 3 Suitable for Restaurants, Promotions, Photo Frames, Events, Meetings 6 Pack 70 50+ viewed in past week Limited time deal 3909 45. In the third option, I included variables that are set by the select statement to demonstrate that you have access to those values. LCKLA Acrylic Sign Holder 8.5 x 11 Clear Plastic Table Menu Holders,T-Shaped Desktop Display Stand Ad Frame. If a break is not performed, the select statement loops and the menu is re-displayed. (10 Pack) Double Fold Panels Menu Covers, Black, 8.5 x 11' Insert, 4 View 40.88 Free shipping 15 Tri Fold Restaurant Hotel Cafe Bar Menu Covers 9' tall 26.00 15.35 shipping Single (one view) Faux Leather Menu Holders Padded (LOT 6) SPECIAL PRICE 30.00 18. Options=("Option 1" "Option 2" "Option 3" "Quit")Įcho "you chose choice $REPLY which is $opt"Īdd break statements wherever you need the select loop to exit. LCKLA Acrylic Sign Holder 8.5 x 11 Clear Plastic Table Menu Holders,T-Shaped Desktop Display Stand Ad Frame.
0 Comments
Leave a Reply. |