Stochastic Nonsense

Put something smart here.

Saving Output of a Command and Echoing to the Screen

When using bash, it’s really nice to both save the output of a command to a file and print it on the screen. I couldn’t find something that did this so I wrote my own ruby script. A utility that does exactly what you want is actually included in a standard linux install, but with a filename that I simply couldn’t google. tee does what you need:

1
$ hadoop --jar $J/job.jar --job asdf | tee -a log.asdf.00

saves stdout to log.job.00 and echoes to screen