{
    "mode": "man",
    "parameter": "expect_unbuffer",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/expect_unbuffer/1/json",
    "generated": "2026-10-21T07:04:28Z",
    "synopsis": "unbuffer program [ args ]",
    "sections": {
        "NAME": {
            "content": "unbuffer - unbuffer output\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "unbuffer program [ args ]\n",
            "subsections": []
        },
        "INTRODUCTION": {
            "content": "unbuffer  disables  the  output  buffering that occurs when program output is redirected from\nnon-interactive programs.  For example, suppose you are watching the output from  a  fifo  by\nrunning it through od and then more.\n\nod -c /tmp/fifo | more\n\nYou will not see anything until a full page of output has been produced.\n\nYou can disable this automatic buffering as follows:\n\n\nunbuffer od -c /tmp/fifo | more\n\nNormally,  unbuffer does not read from stdin.  This simplifies use of unbuffer in some situa‐\ntions.  To use unbuffer in a pipeline, use the -p flag.  Example:\n\nprocess1 | unbuffer -p process2 | process3\n",
            "subsections": []
        },
        "CAVEATS": {
            "content": "unbuffer -p may appear to work incorrectly if a process  feeding  input  to  unbuffer  exits.\nConsider:\nprocess1 | unbuffer -p process2 | process3\n\nIf process1 exits, process2 may not yet have finished.  It is impossible for unbuffer to know\nlong  to  wait for process2 and process2 may not ever finish, for example, if it is a filter.\nFor expediency, unbuffer simply exits when it encounters an EOF  from  either  its  input  or\nprocess2.\n\nIn order to have a version of unbuffer that worked in all situations, an oracle would be nec‐\nessary.   If  you want an application-specific solution, workarounds or hand-coded Expect may\nbe more suitable.  For example, the following example shows how to allow grep to finish  pro‐\ncessing  when  the  cat before it finishes first.  Using cat to feed grep would never require\nunbuffer in real life.  It is merely a placeholder for some imaginary process that may or may\nnot finish.  Similarly, the final cat at the end of the pipeline is also  a  placeholder  for\nanother process.\n\n\n$ cat /tmp/abcdef.log | grep abc | cat\nabcdef\nxxxabc defxxx\n$ cat /tmp/abcdef.log | unbuffer grep abc | cat\n$ (cat /tmp/abcdef.log ; sleep 1) | unbuffer grep abc | cat\nabcdef\nxxxabc defxxx\n$\n",
            "subsections": []
        },
        "BUGS": {
            "content": "The man page is longer than the program.\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "\"Exploring  Expect:  A  Tcl-Based  Toolkit for Automating Interactive Programs\" by Don Libes,\nO'Reilly and Associates, January 1995.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Don Libes, National Institute of Standards and Technology\n\n1 June 1994                                 UNBUFFER(1)",
            "subsections": []
        }
    },
    "summary": "unbuffer - unbuffer output",
    "flags": [],
    "examples": [],
    "see_also": []
}