* tee question [OT]
@ 2008-04-06 4:10 Marc Perkel
2008-04-06 4:30 ` Jan Engelhardt
0 siblings, 1 reply; 3+ messages in thread
From: Marc Perkel @ 2008-04-06 4:10 UTC (permalink / raw)
To: linux-kernel
Just wondering if any of you experts know how to do
this. I want to take an imput stream and produce two
output streams to feed into two different pipes.
echo "1 2 3 4 5" | tee ...
| cut -d \ -f -4 >> file1.txt
| cut -d \ -f 1,2,5- >> file2.txt
The idea being that file1.txt would get "1 2 3 4" and
file2.txt would get "1 2 5"
How do I do it? Tee wants a file as an argument and I
want that file to be a process. Anyhow - I'm not very
smart.
Thanks in advance.
Marc Perkel
Junk Email Filter dot com
http://www.junkemailfilter.com
____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: tee question [OT]
2008-04-06 4:10 tee question [OT] Marc Perkel
@ 2008-04-06 4:30 ` Jan Engelhardt
2008-04-06 4:37 ` Jan Engelhardt
0 siblings, 1 reply; 3+ messages in thread
From: Jan Engelhardt @ 2008-04-06 4:30 UTC (permalink / raw)
To: Marc Perkel; +Cc: linux-kernel
On Sunday 2008-04-06 06:10, Marc Perkel wrote:
> Just wondering if any of you experts know how to do
> this. I want to take an imput stream and produce two
> output streams to feed into two different pipes.
>
> echo "1 2 3 4 5" | tee ...
> | cut -d \ -f -4 >> file1.txt
> | cut -d \ -f 1,2,5- >> file2.txt
>
> The idea being that file1.txt would get "1 2 3 4" and
> file2.txt would get "1 2 5"
>
> How do I do it? Tee wants a file as an argument and I
> want that file to be a process.
> Anyhow - I'm not very smart.
echo "1 2 3 4 5" | \
tee >(cut -d" " -f -4 >>file1.txt) |
tee >(cut something else >>topieces) |
cut -d" " -f 1,2,5- >>file2.txt;
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: tee question [OT]
2008-04-06 4:30 ` Jan Engelhardt
@ 2008-04-06 4:37 ` Jan Engelhardt
0 siblings, 0 replies; 3+ messages in thread
From: Jan Engelhardt @ 2008-04-06 4:37 UTC (permalink / raw)
To: Marc Perkel; +Cc: linux-kernel
On Sunday 2008-04-06 06:30, Jan Engelhardt wrote:
> On Sunday 2008-04-06 06:10, Marc Perkel wrote:
>>
>> echo "1 2 3 4 5" | tee ...
>> | cut -d \ -f -4 >> file1.txt
>> | cut -d \ -f 1,2,5- >> file2.txt
>>
>> The idea being that file1.txt would get "1 2 3 4" and
>> file2.txt would get "1 2 5"
>>
>> How do I do it? Tee wants a file as an argument and I
>> want that file to be a process.
>> Anyhow - I'm not very smart.
>
> echo "1 2 3 4 5" | \
> tee > (cut -d" " -f -4 >>file1.txt) |
> tee > (cut something else >>topieces) |
> cut -d" " -f 1,2,5- >>file2.txt;
>
Everything can be a process, and in almost arbitrary order ... :-)
tee >(cut >file2.txt -d" " -f 1,2,5-) < <(tee >(cut >file1.txt -d" " -f -4) < <(echo "1 2 3 4 5")) >/dev/null
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-04-06 4:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-06 4:10 tee question [OT] Marc Perkel
2008-04-06 4:30 ` Jan Engelhardt
2008-04-06 4:37 ` Jan Engelhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®