How to make output of any shell command unbuffered?

Viewed 75184

Is there a way to run shell commands without output buffering?

For example, hexdump file | ./my_script will only pass input from hexdump to my_script in buffered chunks, not line by line.

Actually I want to know a general solution how to make any command unbuffered?

5 Answers

One should use grep or egrep "--line-buffered" options to solve this. no other tools needed.

Related