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) do # ... done I tried backslashes and quotes, but that did not help. Thank you for any help. Youssef Eldakar Bibliotheca Alexandrina |
It's because ${IFS} lists a space as separator.
OLD_IFS=${IFS}; IFS=" "; select person in $(cat list) quit; do printf "%s${person}\n"; break; done; IFS=${OLD_IFS} |
Thanks!
|
All times are GMT -5. The time now is 08:06 AM. |