LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-29-2011, 08:59 PM   #1
wjtaylor
Member
 
Registered: Feb 2009
Posts: 78

Rep: Reputation: 15
piping data to multiple outputs


Can someone refresh my memory on this? I remember there was a command that would allow me to pipe data to an app and the use the | operator to pipe it into yet another app.

foo fooArg | Iforget app1 | app2

I forget what this command is but it pipes the data from foo into app1 and app2.

Thanks,
WT
 
Old 03-29-2011, 09:05 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
You can use 'tee':

Code:
command | tee >(process1) >(process2) >(process3)
 
Old 03-29-2011, 09:29 PM   #3
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 99
I don't believe that tee can send output to a process. It will
only write to a single file and to standard output.

For example, "command | tee output.txt | command2 | filtered.txt".

WT, can I ask what you're trying to do?
 
Old 03-29-2011, 09:34 PM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
The tee command works as specified. For example:

Code:
$ ls -l | tee >(wc -l) >(wc -c) >(tail -n1) >/dev/null
drwxrwxr-x.   2 mmoneta mmoneta   4096 Feb 28 14:29 Vuze Downloads
3527
53
$
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
redirecting output to multiple outputs granny Linux - General 6 02-13-2004 08:18 AM
piping data tearinox Linux - Newbie 9 12-09-2003 02:43 PM
RedHat 8.0 multiple sound outputs heathimself Linux - Distributions 2 12-06-2003 03:39 AM
multiple outputs from xmms walrus_55 Linux - Software 0 10-20-2003 01:31 AM
piping data to grace DavidPhillips Linux - General 0 09-06-2003 12:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:53 PM.

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