If I have a pipe like cat /dev/somedevice | grep 'test'
that output commands, like for example echo 'test 17'
, the commands appear in realtime (everytime /dev/somedevice
delivers some line). If I however pipe the commands to sh
, they won't be invoked imediately because of pipe buffering. So
cat /dev/somedevice | grep 'test' | sh
wont execute commands in realtime.
Is there any other way that would? With xargs
or something?
sh
to interprete each line separately as soon as each is fed tosh
?cat /dev/smd | stdbuf -o0 grep 'test' | stdbuf -o0 sh