-   Linux - General (
-   -   Bash select statement and spaces (

meshcurrent 04-09-2003 05:51 AM

Bash select statement and spaces
I am trying to do a select statement with an item list that I read from a text file. The text file looks like:

Joe\ Shmo
John\ Smith

I am having trouble getting the select statement to treat first and last name as a single item:

select person in $(< person.list)
# ...

I tried backslashes and quotes, but that did not help.

Thank you for any help.

Youssef Eldakar
Bibliotheca Alexandrina

unSpawn 04-09-2003 07:19 AM

It's because ${IFS} lists a space as separator.
"; select person in $(cat list) quit; do printf "%s${person}\n"; break; done; IFS=${OLD_IFS}

meshcurrent 04-09-2003 09:35 AM


All times are GMT -5. The time now is 09:11 PM.