I have a shell script as follows
ln -s -f /ctf/message/dave.inbox /home/alice/imoprt.inbox
/ctf/message/sendmsg
echo hello
The purpose of the script is to first make a link, then run a program, and provide hello as input to the program. It all works except providing hello as the input. I can do this easily by writing a script just like
echo hello
but then I am unable to do some other things, such as linking before. Is there a way to do this sequence of commands?
echo hello | /ctf/message/sendmsg?printf 'line1\nline2\n' | sendmsg. It depends on what you want to do.sendmsgasynchronously and then let the script continue, feeding data to the program through the fifo.