I'm looking for a way to trick a Linux program into thinking that it is connected to TTY so that output is line-buffered instead of block-buffered.
When I call the program directly inside the terminal emulator it behaves correctly, but if I pipe its output to while read line; do ...; done
or cat
it doesn't.
Basically I would like to end up with something like this:
exec "${some_strange_wrapper}" "${some_program}" | while read line;
do
# Do something...
done