[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: output redirection with process substitution asynchronous?
From: |
pk |
Subject: |
Re: output redirection with process substitution asynchronous? |
Date: |
Fri, 04 Dec 2009 18:58:14 +0000 |
pjodrr wrote:
> Hello,
>
> how can I prefix every line of output of some command with a
> timestamp? I thought like this:
>
> $ exec 3> >(while read line; do echo "$(date): $line"; done)
> $ seq 4 >&3
> Friday, December 4, 2009 4:20:29 PM MET: 1
> $ Friday, December 4, 2009 4:20:29 PM MET: 2
> Friday, December 4, 2009 4:20:29 PM MET: 3
> Friday, December 4, 2009 4:20:29 PM MET: 4
>
> please note that the prompt ($) returns before the command completes.
> Why is the
> process substitution asynchronous?
> Does anybody know of a better way to accomplish this?
What's wrong with
seq 4 | while read line; do echo "$(date): $line"; done
- 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