Create a pipe that writes to multiple files (tee)

后端 未结 5 1690
情话喂你
情话喂你 2021-02-09 14:52

I would like to create a pipe in a ksh script (using exec) that pipe\'s to a tee, and sends the output to a pipe.

Current:

#Redirect EVE         


        
5条回答
  •  北海茫月
    2021-02-09 15:13

    Instead of:

    exec 1>tee -a ${Log} >&3

    do simply:

    tee -a ${Log} >&3 &

    tee will fork into the background, and will consume the calling process' (i.e. your script's) STDIN as it was at the time that tee forked.

提交回复
热议问题