Bash output stream write to a file

后端 未结 4 1279
庸人自扰
庸人自扰 2020-12-11 08:22

so i am running this on bash:

# somedevice -getevent

What this command does is it just keeps running, and everytime my device sends a certa

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-11 08:44

    The command somedevice probably uses the "Standard Input/Output Library", and in that library, the buffering is on by default. It is switched off when the output does to a terminal/console.

    Can you modify the somedevice program? If not, you can still hack around it. See http://www.pixelbeat.org/programming/stdio_buffering/ for details.

提交回复
热议问题