Sending a command for processing using / proc

I have an application that runs as a process on an ubuntu server. This application has a gui command line that allows me to enter a command, then press enter and the command starts. I can script to determine the process id. Then I script should send the following command:

# echo "command" > /proc/<PROCESSID>/fd/0

I tried the options

# 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 that the program receives the command, but does not execute it. I suspect that this is because I do not physically press the enter button, and perhaps on the command line it expects. Can someone advise me how I use this wrong or best option?

+5
source share
2

. /proc/fd/ 0 () , .

, stdin, -, ( ..), .

(. mknod (1) mkfifo (3)).

, , .

+4

, , , : expect

+2

All Articles