LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Automatically append another piped command to issued command in bash (https://www.linuxquestions.org/questions/programming-9/automatically-append-another-piped-command-to-issued-command-in-bash-724365/)

amateen 05-07-2009 06:14 AM

Automatically append another piped command to issued command in bash
 
Asslam-u-Alikum,
Hi,

I am stucked at the point, I want to append | tee -a file.txt for every command that is issued from bash, How to acomplish it ? do any body knows, ?

e.g
if ls command is issued by the user
the bash should append | tee -a file.txt to that command issued
it then completes as ls | tee -a file.txt

Thank You.

druuna 05-07-2009 06:36 AM

Hi,

Maybe you should take a look at script, which will, and I quote from the manpage:
Quote:

Script makes a typescript of everything printed on your terminal. It is
useful for students who need a hardcopy record of an interactive session
as proof of an assignment, as the typescript file can be printed out
later with lpr(1).
Do take a look at script's manpage.

Hope this helps.


All times are GMT -5. The time now is 02:23 AM.