./a.out | tee > logfile.txtIt is not smooth, as the terminal is buffering data. To change that, use
unbuffer ./a.out | tee > logfile.txtTo use unbuffer, you must install the "expect" package*
References
https://stackoverflow.com/questions/11337041/force-line-buffering-of-stdout-when-piping-to-tee *to get it on Mac unix, the package installer recommended is homebrew.
1) install homebrew if you don't have it.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2) Search for the desired package "expect"
brew search expect
3) it's found, so install it.
brew install expect
No comments:
Post a Comment