[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: output redirection with process substitution asynchronous?
From: |
pjodrr |
Subject: |
Re: output redirection with process substitution asynchronous? |
Date: |
Sat, 5 Dec 2009 01:14:59 -0800 (PST) |
User-agent: |
G2/1.0 |
Hello,
On Dec 4, 8:18 pm, DennisW <dennistwilliam...@gmail.com> wrote:
> It works for me. Does it not for you? If you're asking why not do it,
> then the answer is "why call an external program unnecessarily?".
>
> Sorry, by the way, I missed what you were doing with the file
> descriptor on my first read. What is it that you're trying to
> accomplish? Are you doing this only to number the lines or is either
> seq or the while loop a stand-in for something else?
the seq was only an example for demonstration.
here is another example that shows what I mean:
$ exec 3> >(while read line; do echo "tag: $line"; done)
$ seq 4 >&3
tag: 1
tag: 2
tag: 3
tag: 4
$ exec 3> >(while read line; do echo "$(date): $line"; done)
$ seq 4 >&3
$ Sat Dec 5 10:11:25 CET 2009: 1
Sat Dec 5 10:11:25 CET 2009: 2
Sat Dec 5 10:11:25 CET 2009: 3
Sat Dec 5 10:11:25 CET 2009: 4
while in the first example the prompt returns after the
command completes, the prompt returns immediately
in the second example.
thanks for your attention,
Peter
- output redirection with process substitution asynchronous?, pjodrr, 2009/12/04
- Re: output redirection with process substitution asynchronous?, pjodrr, 2009/12/05
- Re: output redirection with process substitution asynchronous?, pk, 2009/12/05
- Re: output redirection with process substitution asynchronous?, pjodrr, 2009/12/06
- Re: output redirection with process substitution asynchronous?, pk, 2009/12/06
- Re: output redirection with process substitution asynchronous?, Marc Herbert, 2009/12/07
- Re: output redirection with process substitution asynchronous?, Greg Wooledge, 2009/12/07
- Re: output redirection with process substitution asynchronous?, Marc Herbert, 2009/12/07
- Message not available
- Re: output redirection with process substitution asynchronous?, DennisW, 2009/12/07