Re: bbc script

2021-08-20 Thread tomas
On Thu, Aug 19, 2021 at 08:56:22PM -0400, Greg Wooledge wrote: > > On Thu, 19 Aug 2021, Greg Wooledge wrote: > > > Also relevant: https://mywiki.wooledge.org/BashFAQ/115 Great explanation, Greg. I wish I had half of your talent :) One small addendum: the "predefined strings" in the case statement

Re: bbc script

2021-08-19 Thread Greg Wooledge
> On Thu, 19 Aug 2021, Greg Wooledge wrote: > > Also relevant: https://mywiki.wooledge.org/BashFAQ/115 On Thu, Aug 19, 2021 at 07:40:23PM -0400, Jude DaShiell wrote: > I had a read of your wiki article and think I almost understand it. To > the left of the parens there's a single letter in that

Re: bbc script

2021-08-19 Thread Jude DaShiell
I had a read of your wiki article and think I almost understand it. To the left of the parens there's a single letter in that calculator example. That I understand. If you have a) add as part of the case statement is add in that partial case statement so when that selection is made add appears o

Re: bbc script

2021-08-19 Thread Jude DaShiell
Thanks to all who have replied. It turns out too much code was on case statement and once I cleared that the script now works as expected. Here's the working version: #!/usr/bin/env bash # file: bbc.sh PS3="Enter a number to Choose station: " select station in bbc1 bbc-1-extra bbc-2 bbc-3 bbc-4 \

Re: bbc script

2021-08-19 Thread Thomas Schmitt
Hi, rhkra...@gmail.com wrote: > I don't see where your selection (in PS3) gets transferred to REPLY REPLY is filled by bash command "select". man bash says: select name [ in word ] ; do list ; done [...] The PS3 prompt is then displayed and a line read from the sta

Re: bbc script

2021-08-19 Thread Greg Wooledge
On Thu, Aug 19, 2021 at 08:25:10AM -0400, rhkra...@gmail.com wrote: > On Thursday, August 19, 2021 04:59:19 AM Jude DaShiell wrote: > > #!/usr/bin/env bash > > # file: bbc.sh > > PS3="Enter a number to Choose station: " > > select station in bbc1 bbc-1-extra bbc-2 bbc-3 bbc-4 \ > >

Re: bbc script

2021-08-19 Thread rhkramer
On Thursday, August 19, 2021 04:59:19 AM Jude DaShiell wrote: > I tested the following script by having the $REPLY variable report its > value after the select statement and the value I entered was correct. > The problem I'm having is with the case statement I used. For some reason > the case stat

Re: bbc script

2021-08-19 Thread Thomas Schmitt
Hi, Jude DaShiell wrote: > select station in bbc1 bbc-1-extra bbc-2 bbc-3 bbc-4 \ >b bc-4-long-wave-and-shipping > bbc-4-extra bbc-5 \ > bbc-6-music bbc-world-service quit > do > case $REPLY in >$REPLY==1) man bash says about "case" that before