I am taking output of one script, then piping this putput to grep and piping the output of grep into another script:
./script1 | grep 'expr' | ./script2
However, the second script never gets any input. Again, nothing gets printed when I substitute script2
with cat
and script1
with ping
:
ping localhost | grep localhost | cat
Same thing happens if I replace grep
with awk
:
ping localhost|awk '{print $1}'|cat
What is going on?