bug-bash
[Top][All Lists]
Advanced

[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: Tue, 8 Dec 2009 05:00:15 -0800 (PST)
User-agent: G2/1.0

On Dec 8, 10:55 am, Marc Herbert <address@hidden> wrote:
> DennisW wrote :
>
> > Would you care to comment on the coproc command in Bash 4?
>
> I wish I could, but I know nothing about it. Anyone else?

yeah, I tried that:

prefix_timestamp() {
    while read line; do
        echo "$(date): $line"
    done
}

coproc prefix_timestamp
seq 10>&${COPROC[1]}
eval "exec ${COPROC[1]}>&-"
cat <&${COPROC[0]}
wait $COPROC_PID

but am not sure if I like that construct better.

  Peter


reply via email to

[Prev in Thread] Current Thread [Next in Thread]