* 2010-02-14 10:04 (-0600), John Salmon wrote:
> Is there a way to change the field seperators in Bash's read command
> (Debian Lenny)?
The answer has been given but here's an example script which uses
"read":
#!/bin/bash
IFS=, read -a numbers < <(echo one,t w o,three)
printf '<%s>\n' "${numbe...@]}"
It will print:
<one>
<t w o>
<three>
In this case "read" is not necessary. This would do the same:
#!/bin/bash
IFS=, numbers=( $(echo one,t w o,three) )
printf '<%s>\n' "${numbe...@]}"
--
Feel free to Cc me your replies if you want to make sure I'll notice
them.
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]