LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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, 07: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, 07:36 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:29 PM
Shell-script should control a piped command -> PROBLEM waldese Linux - General 8 09-29-2006 04:27 AM
Timestamp of previous command issued benjaminrtz Linux - General 1 04-16-2005 02:53 AM
Problem executing this piped command: JAVA randomx Programming 1 07-16-2004 08:39 PM
How to redirect standard output of piped command to log file andrewstr Linux - General 10 02-04-2004 03:07 PM


All times are GMT -5. The time now is 10:43 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration