LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-07-2009, 06:14 AM   #1
amateen
LQ Newbie
 
Registered: Dec 2004
Posts: 16

Rep: Reputation: 0
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.
 
Old 05-07-2009, 06:36 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
stopping command issued from shell script mr_scary Programming 10 01-12-2007 03:29 PM
Shell-script should control a piped command -> PROBLEM waldese Linux - General 8 09-29-2006 03:27 AM
Timestamp of previous command issued benjaminrtz Linux - General 1 04-16-2005 01:53 AM
Problem executing this piped command: JAVA randomx Programming 1 07-16-2004 07:39 PM
How to redirect standard output of piped command to log file andrewstr Linux - General 10 02-04-2004 02:07 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration