#!/bin/bash
echo "print('Hello 1')" | python3
cat | python3 -u <<EOF
print('Hello 2')
EOF
echo "print('Hello 3')" | python3
This outputs
Hello 1
Hello 2
It will wait for me to press enter before printing the final Hello 3
. It does this also using python's -u
flag for unbuffered output.
Why does it do this for cat
but not for echo
?