There is the terminal command unbuffer in Linux Redhat, for instance. I did not find it in homebrew.

How can you install unbuffer in OSX Yosemite 10.10.3?


unbuffer is part of the expect package:

brew install homebrew/dupes/expect

You may need to:

brew tap homebrew/dupes/expect

Before you can install it.

UPDATE: As of 2018 expect is available without prefix in homebrew, thus:

brew install expect

is all that is necessary.

  • I love expect! How did you find it out? – Léo Léopold Hertz 준영 Jun 26 '15 at 8:56
  • 6
    I searched for “unbuffer command” and found a man page which told me the author was Don Libes. Searched for “unbuffer Don Libes” and found another man page which said “This page is part of the expect (programmed dialogue with interactive programs) project”. I then looked at the OS X man page for except and tried a few things out, and failed. I then searched homebrew for expect and found there to be a package. I installed it, et voila! – forquare Jun 26 '15 at 9:25
  • I also found that I needed to do this prior to executing unbuffer: export TCLLIBPATH="/usr/local/lib" I found that this: unbuffer ./run-math-tests.sh | tee results.txt which runs a node script with colorized output, put the expected color codes into the results.txt file, which showed up properly with cat in the standard bash for macOS High Sierra 10.13.6 ... it's possible to brew install a newer bash but it was unneccessary for my needs. – Cognitiaclaeves Dec 7 '18 at 18:08
  • Thanks! Any tips how to find it on Big Sur? – mjalajel Mar 7 at 18:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .