When I use
tee to pipe stdout directly to a "specific block of code" (which then writes the modified data to a file), I always get the full complement of exptected output lines in the file.
However, when I
tee the same data to a process
>("same block of code"), it can drop up to 4 lines from the output. This number varies; sometimes it writes all the lines.
How can I get around this issue, and why is it only happening in the
>( process ) ?
More info: I am 'tee'-ing to 2 process-substitutions and also to normal stdout pipe when this line dropping occurs.
using GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu) on Ubuntu 10.04.2 LTS.
Here is the actual script. The second process-substitution is the one in question, the one beginning with
>(tr $'\x60' $X01
# # Run 'locate' and direct the output to a temp file errflag="" locitmct=0 # Count of located items columns=4 # The number of columns in the main dialog colmnb=0 # Column number (NB: columns 1 and 2 are processed together) X01=$'\x01' eval locate $zenargs |tee \ >(zenity --progress --pulsate --auto-close) \ >(tr $'\x60' $X01 \ |sed -n "s/^\(.*\/\)\(.*\)/\1\2\n\2\n\1/p" \ |while IFS= read -r line ; do \ # # # process the data # # done > "$listf" )\ >/dev/null # cat "$listf" #