Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
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
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.