ctubbsii commented 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, the 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:
[email protected]


With regards,
Apache Git Services

Reply via email to