I have an application which runs as a process on a ubuntu server. This application has command line gui which allows me to type in a command, then press enter and the command runs. I am able to script the determination of the process id. I then script the following to send it a command:
# echo "command" > /proc/<PROCESSID>/fd/0
I have tried variations of
# echo "command" > /proc/<PROCESSID>/fd/0
# echo -e "command\r" > /proc/<PROCESSID>/fd/0
# echo -e "command\c" > /proc/<PROCESSID>/fd/0
# echo -e "\015" > /proc/<PROCESSID>/fd/0
I know the program is getting the command but does not execute it. I suspect this is because I am not physically pressing enter and possibly the command line is expecting this. Can someone advise me on how I am using this incorrectly or a better option?
Thanks in advanced for the help!