Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

unbuffer(1) [redhat man page]

UNBUFFER(1)						      General Commands Manual						       UNBUFFER(1)

NAME
unbuffer - unbuffer output SYNOPSIS
unbuffer program [ args ] INTRODUCTION
unbuffer disables the output buffering that occurs when program output is redirected. For example, suppose you are watching the output from a fifo by running it through od and then more. od -c /tmp/fifo | more You will not see anything until a full page of output has been produced. You can disable this automatic buffering as follows: unbuffer od -c /tmp/fifo | more When you have a pipeline, unbuffer must be applied to each element except the last (since that doesn't have its output redirected). Exam- ple: unbuffer p1 | unbuffer p2 | unbuffer p3 | p4 BUGS
The man page is longer than the program. SEE ALSO
"Exploring Expect: A Tcl-Based Toolkit for Automating Interactive Programs" by Don Libes, O'Reilly and Associates, January 1995. AUTHOR
Don Libes, National Institute of Standards and Technology 1 June 1994 UNBUFFER(1)

Check Out this Related Man Page

UNBUFFER(1)						      General Commands Manual						       UNBUFFER(1)

NAME
unbuffer - unbuffer output SYNOPSIS
unbuffer program [ args ] INTRODUCTION
unbuffer disables the output buffering that occurs when program output is redirected from non-interactive programs. For example, suppose you are watching the output from a fifo by running it through od and then more. od -c /tmp/fifo | more You will not see anything until a full page of output has been produced. You can disable this automatic buffering as follows: unbuffer od -c /tmp/fifo | more Normally, unbuffer does not read from stdin. This simplifies use of unbuffer in some situations. To use unbuffer in a pipeline, use the -p flag. Example: process1 | unbuffer -p process2 | process3 CAVEATS
unbuffer -p may appear to work incorrectly if a process feeding input to unbuffer exits. Consider: process1 | unbuffer -p process2 | process3 If process1 exits, process2 may not yet have finished. It is impossible for unbuffer to know long to wait for process2 and process2 may not ever finish, for example, if it is a filter. For expediency, unbuffer simply exits when it encounters an EOF from either its input or process2. In order to have a version of unbuffer that worked in all situations, an oracle would be necessary. If you want an application-specific solution, workarounds or hand-coded Expect may be more suitable. For example, the following example shows how to allow grep to finish pro- cessing when the cat before it finishes first. Using cat to feed grep would never require unbuffer in real life. It is merely a place- holder for some imaginary process that may or may not finish. Similarly, the final cat at the end of the pipeline is also a placeholder for another process. $ cat /tmp/abcdef.log | grep abc | cat abcdef xxxabc defxxx $ cat /tmp/abcdef.log | unbuffer grep abc | cat $ (cat /tmp/abcdef.log ; sleep 1) | unbuffer grep abc | cat abcdef xxxabc defxxx $ BUGS
The man page is longer than the program. SEE ALSO
"Exploring Expect: A Tcl-Based Toolkit for Automating Interactive Programs" by Don Libes, O'Reilly and Associates, January 1995. AUTHOR
Don Libes, National Institute of Standards and Technology 1 June 1994 UNBUFFER(1)
Man Page

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help capturing and reformatting buffered and unbuffered output

Ok, so I have a shell script which runs a specific command, and that command sends it's output to the display. At certain times, the command sends buffered output, and at other times, the command sends unbuffered output in the form of a % progress bar, so if I run the command, the output I receive... (0 Replies)
Discussion started by: vikingshelmut
0 Replies

2. Programming

unbuffered streams.

#include "../ourhdr.h" int main(void) { int c; char *buf; setvbuf(stdin,buf,_IONBF,10); setvbuf(stdout,buf,_IONBF,10); while((c=getc(stdin)) != EOF) { if(putc(c,stdout) == EOF) err_sys("output... (2 Replies)
Discussion started by: gandhevinod
2 Replies

3. Emergency UNIX and Linux Support

rsync: writefd_unbuffered failed

hi guys. I have configured rsync to make a mirror, but there is an error, I don't understand in the logfile: 2011/01/18 16:54:25 rsync on centos/ from UNKNOWN (212.120.196.127) 2011/01/18 15:56:00 rsync: writefd_unbuffered failed to write 4 bytes : Connection reset by peer (104)... (4 Replies)
Discussion started by: majid.merkava
4 Replies

4. Homework & Coursework Questions

grep Simulation Using Only Unbuffered I/O - C

1. The problem statement, all variables and given/known data: Basically, I'm trying to search for a particular string pattern within a text file and print "textfile: line_no line". I need to read this in line at a time, but I'm restricted to using unbuffered I/O functions. I'm not sure if I'm... (3 Replies)
Discussion started by: jdkirby
3 Replies