cancel
Showing results for 
Search instead for 
Did you mean: 

Unbuffered pipes

Thomas Boerner_1
Occasional Visitor

Unbuffered pipes

Hi all,

this is probably an easy one but I didn't figure it out yet: How do I make a pipe unbuffered? I get output normally only after a page (4k) is full or when the pipe is closed. But I need it immediately. My case: starting a ppp connection from script and checking success; or grepping lines from /var/log/messages and sending to different application.

Thx for your help in advance
Thomas
1 REPLY
Vincent Fleming
Honored Contributor

Re: Unbuffered pipes

I use "tail +0f" to do this. It's line-buffered, which is appropriate for watching a log file or command output live.

For example:

# tail +0f /var/log/messages

You could pipe to it as well:

# my_ppp_command 2>&1 | tail +0f

which would gather both stdout and stderr, and show you a line every time one was printed out.

Give it a try. Good luck!
No matter where you go, there you are.