How can I append | tee ~/.output
to every single bash command?
I want to output the results of the last command so I can use them in a $variable.
How can I append | tee ~/.output
to every single bash command?
I want to output the results of the last command so I can use them in a $variable.
I you want to append a string to every bash command you can do it by rebinding your enter
key to add the command string. Or if you prefer create a secondary enter key and use it.
You should do something like this:
bind 'RETURN: " | tee ~/.output \n"'
In this way, everytime you press enter
the | tee ~/.output
get appended.
This is a bash
only solution.