coreutils: stdbuf invocation
1
1 23.5 ‘stdbuf’: Run a command with modified I/O stream buffering
1 ===============================================================
1
1 ‘stdbuf’ allows one to modify the buffering operations of the three
1 standard I/O streams associated with a program. Synopsis:
1
1 stdbuf OPTION... COMMAND
1
1 COMMAND must start with the name of a program that
1 1. uses the ISO C ‘FILE’ streams for input/output (note the programs
1 ‘dd’ and ‘cat’ don’t do that),
1
1 2. does not adjust the buffering of its standard streams (note the
1 program ‘tee’ is not in this category).
1
1 Any additional ARGs are passed as additional arguments to the
1 COMMAND.
1
11 The program accepts the following options. Also see ⇒Common
options.
1
1 ‘-i MODE’
1 ‘--input=MODE’
1 Adjust the standard input stream buffering.
1
1 ‘-o MODE’
1 ‘--output=MODE’
1 Adjust the standard output stream buffering.
1
1 ‘-e MODE’
1 ‘--error=MODE’
1 Adjust the standard error stream buffering.
1
1 The MODE can be specified as follows:
1
1 ‘L’
1 Set the stream to line buffered mode. In this mode data is
1 coalesced until a newline is output or input is read from any
1 stream attached to a terminal device. This option is invalid with
1 standard input.
1
1 ‘0’
1 Disable buffering of the selected stream. In this mode, data is
1 output immediately and only the amount of data requested is read
1 from input. Note the difference in function for input and output.
1 Disabling buffering for input will not influence the responsiveness
1 or blocking behavior of the stream input functions. For example
1 ‘fread’ will still block until ‘EOF’ or error, even if the
1 underlying ‘read’ returns less data than requested.
1
1 ‘SIZE’
1 Specify the size of the buffer to use in fully buffered mode. SIZE
1 may be, or may be an integer optionally followed by, one of the
1 following multiplicative suffixes:
1 ‘KB’ => 1000 (KiloBytes)
1 ‘K’ => 1024 (KibiBytes)
1 ‘MB’ => 1000*1000 (MegaBytes)
1 ‘M’ => 1024*1024 (MebiBytes)
1 ‘GB’ => 1000*1000*1000 (GigaBytes)
1 ‘G’ => 1024*1024*1024 (GibiBytes)
1 and so on for ‘T’, ‘P’, ‘E’, ‘Z’, and ‘Y’.
1
1 ‘stdbuf’ is installed only on platforms that use the Executable and
1 Linkable Format (ELF) and support the ‘constructor’ attribute, so
1 portable scripts should not rely on its existence.
1
1 Exit status:
1
1 125 if ‘stdbuf’ itself fails
1 126 if COMMAND is found but cannot be invoked
1 127 if COMMAND cannot be found
1 the exit status of COMMAND otherwise
1