Messages in this thread |  | | | Date | Sun, 6 Apr 2008 06:30:24 +0200 (CEST) | | From | Jan Engelhardt <> | | Subject | Re: tee question [OT] |
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;
|  |