[Top][All Lists]

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

process substitution

From: Ralf Goertz
Subject: process substitution
Date: Mon, 12 Oct 2009 12:14:56 +0200
User-agent: KNode/0.10.9


is it possible to have a process substitution with both input and output
redirection? So far I use the following work-around

> cat parentprocess.sh:
mkfifo fifo 2>/dev/null
exec 5> >(./subprocess.sh > fifo)
exec 6< <(cat < fifo)
echo input to subprocess 1>&5
echo done sending input
sleep 1
while read -u 6 ; do
echo parent process read: $REPLY
exec 5>&-
echo about to exit parent process rm fifo

> cat subprocess.sh:
echo subprocess start
sleep 1
echo read: $REPLY
echo subprocess end

Is there another way to do that, something like fork, which wouldn't use
a named pipe explicitely?


reply via email to

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