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?

1 Answer 1


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? Jun 26, 2015 at 8:56
  • 7
    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, 2015 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. Dec 7, 2018 at 18:08
  • Thanks! Any tips how to find it on Big Sur?
    – mjalajel
    Mar 7, 2021 at 18:40
  • Unfortunately, this doesn't seem to work if you have conda installed. The solution for Linux is to install expect via conda, but that package only exists for Linux, not macOS. See askubuntu.com/questions/1047900/… May 10, 2022 at 14:47

You must log in to answer this question.

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