You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/usr/bin/env bashecho"PROD: OUT: LINE 1">/dev/stdout
echo"PROD: OUT: LINE 2">/dev/stdout
echo"PROD: ERR: LINE 1">/dev/stderr
echo"PROD: ERR: LINE 2">/dev/stderr
/tmp/consumer.bash
#!/usr/bin/env bashwhileread -r line;doecho"STDERR: line read: $line">/dev/stderr
echo"STDOUT: line read: $line">/dev/stdout
done
and execute
python /tmp/test.py
The output is:
STDOUT: line read: PROD: OUT: LINE 1
STDOUT: line read: PROD: OUT: LINE 2
PROD: ERR: LINE 1
PROD: ERR: LINE 2
However, my expectation would be:
PROD: ERR: LINE 1
PROD: ERR: LINE 2
STDERR: line read: PROD: OUT: LINE 1
STDOUT: line read: PROD: OUT: LINE 1
STDERR: line read: PROD: OUT: LINE 2
STDOUT: line read: PROD: OUT: LINE 2
The STDERR: line read... outputs of the rear of the pipe are swallowed somehow.
The text was updated successfully, but these errors were encountered:
Take the following constructs:
/tmp/test.py
/tmp/producer.bash
/tmp/consumer.bash
and execute
python /tmp/test.py
The output is:
However, my expectation would be:
The
STDERR: line read
... outputs of the rear of the pipe are swallowed somehow.The text was updated successfully, but these errors were encountered: