[ale] OT Bash Select Stmt
Geoffrey
esoteric at 3times25.net
Mon Nov 29 08:17:07 EST 2004
linux wrote:
>
> Anyone know a way to do the following.
>
> I have the following lines in a file
>
> Wspan01 06
> Wspan02 06
>
> I want to read them and put them in a select statement similar to
>
> select name in ... Both Quit
>
> such that the ... is the lines read and the select list look like this
>
> 1) Wspan01 06
> 2) Wspan02 06
> 3) Both
> 4) Quit
>
>
> Tried everything I know and cant get it to work always wants to split
> lines read into two Selections, no matter what FS is set to.
I don't know this is possible with select as it works, as you've likely
figured out, you end up with each line being split across different
select options. You might be able to build your own select by using
something like:
while read foo; do
...
...
...
done < file_that_contains_the_data_you_mentioned
As the read above will stick the whole line into the variable.
The difficult part is likely going to be filling in the rest of the code. :(
--
Until later, Geoffrey
More information about the Ale
mailing list