How to unbuffer stdout of legacy running binary without stdbuf and similar tools

Viewed 1245

I want to monitor the realtime output of a program that I will start. I am trying to do this by redirecting the output of the program to a pipe and then reading the pipe from a monitoring script.

./program >> apipe

then from the monitoring script

cat apipe

However due to the buffer in >> there is no output. Anyway I can disable this buffer? I am running on a barebones embedded system (petalinux) so I don't have access to unbuffer, script, or stdbuf to help me out.

I have tried the scripts on another platform where unbuffer is available it works as I expect.

Any way I can configure this buffer, or use another binary to redirect?

Edit: I do not have access to the source code of the command I am trying to run. It is a legacy binary.

1 Answers
Related