I have something like this to do:
- I have an application that is made to take text like "a = 1" from stdin.
- Create a script for:
- Create a pipe and redirect it to be stdin for application above,
- Create second pipe, for user.
- In loop:
- Open second pipe and read.
- After reaching the end send that to first one and ^E
- Repeat.
I have done something like this and this doesn't work. There is problem with ambigious redirection (line 16) and wrong file descriptor (line 15). What's wrong?
mkfifo f1
mkfifo f2
p1 = /f1
p2 = /f2
exec 5<> $p1
./fifo -D $1 0<&5 &
while : ; do
while read L ; do
echo $L >&5
done <$p2
echo "5" >&5
done