I can run these two commands:
nc -l localhost 8888 -v >> output.txt &
(while true;do sleep 1;echo a;done)|nc localhost 8888 &
All works as expected with output.txt
filling with "a"s (tailed from different terminal). But if type a single character into the terminal running the background jobs the sending nc
turns from Running
to Stopped
:
$ jobs
[1]+ Stopped nc -l localhost 8888 -v >> output.txt
[2]- Running ( while true; do
sleep 1; echo a;
done ) | nc localhost 8888 &
Also note it looses its "backgrounding" ampersand. Don't know where to begin debugging this. Is this expected behaviour? Thanks.
Mac OSX 10.9, GNU Bash 3.2.52