Manual Reference Pages - LIBSTDBUF (3)
- preloaded library to change standard streams initial buffering
library is meant to be preloaded with the
environment variable to as to change the initial buffering
of standard input, standard output and standard error streams.
Although you may load and configure this library manually,
can be used to run a command with the appropriate environment variables.
Each stream can be configured independently through the following
environment variables (values are defined below):
Initial buffering definition for the standard input stream
Initial buffering definition for the standard output stream
Initial buffering definition for the standard error stream
Each variable may take one of the following values:
fully buffered with the default buffer size
fully buffered with a buffer of
bytes (suffixes k, M and G are accepted)
In the following example, the stdout stream of the
will be fully buffered by default because it does not refer
to a terminal.
is used to force it to be line-buffered so
vmstat 8 s
output will not stall until the full buffer fills.
# vmstat 1 | LD_PRELOAD=/usr/lib/libstdbuf.so \
STDBUF_1=L awk $2 > 1 || $3 > 1 | cat -n
See also the manpage of
for a simpler way to do this.
library first appeared in
.Fx 8.4 .
The original idea of the
command comes from
.An Padraig Brady
who implemented it in the GNU coreutils.
.An Jeremie Le Hen
implemented it on
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.