Is there a way in bash or zsh to automatically pipe all output from any commands I run through another program?
For example, if I ran this command
$ cat /tmp/it
I'd like it to run like I had written it like so:
$ cat /tmp/it | tee /tmp/cmdoutput
where the | tee /tmp/cmdoutput
part could be any command at all. My use cases are for colorization and for saving output for commands I run so I can edit them in vim, or search them in vim. I do these things already manually but want to know if there's a way to do this automatically, and am looking for a general solution!
bash | tee /tmp/cmdoutput