I am trying to launch two Python scripts in bash
and pipe stdout
from one of them to stdin
of the other. The first script outputs a single number every second.
./script1 | ./script2
./script1 > ~/file &; tail -f ~/file
I tried those, but can't get it working. script1
outputs via Python's print
, while script2 is tested with echo "21.11 22.23 33.233" | ./script2
and is known to work.
If I terminate script1
ofter some time, and then cat ~/file
, I see the actual data. However, at the time of execution, neither of the above examples work.
How do I make this work? I would like to be able to work both with and without intermediate file.