"read" array variables via pipe vs. redirection
I'm having a problem "read"ing array variables via a pipe, but it works
fine using redirection of stdin.
$ bash --version
GNU bash, version 3.1.17(1)-release ...
"${function}" produces e.g.:
566 269 732 435
"${function}" | read -a var; echo ${#var[@]} ${var[*]}
0
however:
"${function}" > file; read -a var < file; echo ${#var[@]} ${var[*]}
4 566 269 732 435
Is it possible to get the array variables assigned using the pipe
structure please? I don't wish to generate a temporary file if at all
possible.
|