[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 |
Hi,
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:
#!/bin/bash
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
done
exec 5>&-
echo about to exit parent process rm fifo
> cat subprocess.sh:
#!/bin/bash
echo subprocess start
read
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?
Ralf
- process substitution,
Ralf Goertz <=
- Message not available