You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@fluo.apache.org by GitBox <gi...@apache.org> on 2018/07/20 05:23:57 UTC

[GitHub] ctubbsii edited a comment on issue #185: Calling uno within a script fails

ctubbsii edited a comment on issue #185: Calling uno within a script fails
URL: https://github.com/apache/fluo-uno/issues/185#issuecomment-406467477
 
 
   I'm inclined to call this a bug in the caller... not in the uno script. It can be worked around by avoiding the pipe in the `| while read`, which hijacks file descriptors and keeps them in use during the loop.
   
   For example, this fails:
   
   ```bash
   { for x in "a 1" "b 2" "c 3"; do echo $x; done; } | while read y; do echo >&0 "->$y"; done
   ```
   
   But reading the input into an array first, and then looping over the array works fine:
   
   ```bash
   readarray -t z < <(for x in "a 1" "b 2" "c 3"; do echo $x; done;); for y in "${z[@]}"; do echo >&0 "->$y"; done
   ```
   
   In the above examples, I'm using the `for x` loop to simulate an input file.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services