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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-29-2011, 08:59 PM
|
#1
|
Member
Registered: Feb 2009
Posts: 78
Rep:
|
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
|
|
|
03-29-2011, 09:05 PM
|
#2
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
You can use 'tee':
Code:
command | tee >(process1) >(process2) >(process3)
|
|
|
03-29-2011, 09:29 PM
|
#3
|
Member
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703
Rep:
|
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?
|
|
|
03-29-2011, 09:34 PM
|
#4
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
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
$
|
|
|
All times are GMT -5. The time now is 04:53 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|