help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About using COPROC


From: Marco Ippolito
Subject: Re: About using COPROC
Date: Fri, 2 Apr 2021 18:31:33 -0300

> Besides that it works, shouldn't it be:
> 
> exec 3<&"${COPROC[0]}"
> 
> Looks like both directions are in place.

Or directly, without using `exec`, feeding into the coproc a value which it
processes and returns to the initiator via the pipe:

    coproc {
        read -r incoming
        echo "I see you, $incoming"
    }

    echo Tony Stark >&"${COPROC[1]}"
    cat <&"${COPROC[0]}"


Outputs:

    I see you, Tony Stark



reply via email to

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