Search code examples
shellcommand-linetclunbufferedunbuffered-output

How can I achieve unbuffering without Tcl?


I'm a happy user of unbuffer, but am now faced with a system that doesn't have Tcl installed (and I don't have root privileges).

Can I achieve the same effect without using Tcl? A scripting solution would be nice, but I would not be averse to even writing some C...


Solution

  • Reading the man page of stdbuf, it seems the following might do it:

    stdbuf --output=0
    

    ... followed by your command, on the same command-line (like you're used to with unbuffer).

    You can also "unbuffer" your stdin and/or stderr if you like, with --input=0 and --error=0.