[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] OT Bash Select Stmt
- Subject: [ale] OT Bash Select Stmt
- From: esoteric at 3times25.net (Geoffrey)
- Date: Mon Nov 29 08:17:07 2004
- In-reply-to: <[email protected]>
- References: <[email protected]>
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