How can I pipe the output of *all* entered shell commands into another? (e.g. pipe everything into 'lolcat')

Good Afternoon,

(OS X user)

I am specifically trying to pipe the output of every shell command I type into the ruby gem 'lolcat' (which makes the output to the terminal rainbow colored).

Is there a way to do this without explicitly aliasing command individually? I was thinking perhaps there might be a way to pipe anything before the return key is pressed , but I am not sure how to do this.

Your assistance is appreciated, as I am tired of looking at just one color in my terminal.


Solution 1:

You can redirect stdout in your shell:

exec 1> >(lolcat)

BUT

if lolcat sends its own output to stdout, you're bound to run into problems. This might work

exec 1> >(lolcat >&2)

Solution 2:

You could do this:

bash | lolcat

this enters into bash and whatever command you run will be rainbow