Ted Okuzumi wrote:
I am writing this e-mai to report to report a bug in bash
Description:
Cannot redirect into an array from multiline variable
Does not work:
echo "$mydata" | while read line; do myarray+=( "$line" ); done
----
Have you tried this?
Ishtar:> a='this
is
a
test'
Ishtar:> echo "$a"
this
is
a
test
Ishtar:> readarray b < <(echo "$a")
Ishtar:> echo ${#b[*]}
4
Ishtar:> echo ${b[*]}
this is a test
Ishtar:> echo "${b[*]}"
this
is
a
test
Ishtar:> echo -n "${b[*]}"
this
is
a
test
Ishtar:> readarray -t b < <(echo "$a")
Ishtar:> echo "${b[*]}"
this is a test
Ishtar:> echo ${b[*]}
this is a test
Ishtar:>
-------------
Seeems like you can have it anyway you want it...?
Does the above work for you?