I wish to send a command to process A, from process B, via a FIFO.
The command will be a word or a sentence, but wholly contained on a "\n" terminated line - but could, in general, be a multi-line record, terminated by another character.
The relevant portion of the code that I tried, looks something like this:
$ mkfifo ff $ read x < ff
Process B: (from another terminal window)
$ echo -n "cmd" > ff $ echo -n " arg1" > ff $ echo -n " arg2" > ff ... $ echo " argN" > ff
However, what's happening is, the
read returns with the value
cmd, even though the
bash man page says it, by default, reads
\n terminated lines, unless the
-d delim option is used.
So, I next tried specifying
-d delim explicitly,
$ read -d "\n" x < f`
and still the same result.
echo -n be closing the FIFO's file 'descriptor'?
I'm using bash 4.4.x on Ubuntu 18.04.