2

I hope that this question won't be too ambiguous.

I would like to achieve following thing.

[user@host]# ./my_program SET THIS AS NEXT COMMAND THAT YOU CAN EDIT
[user@host]# SET THIS AS NEXT COMMAND THAT YOU CAN EDIT

Is there any way of achieving it without writing explicitly to a file descriptor?

I have a working shell, let's say with PID 10150. My current solution is following:

Console 1:

[user@host]# echo $$
10150
[user@host]#

Console 2:

[user@host]# echo -n "SET THIS AS NEXT COMMAND THAT YOU CAN EDIT" > /proc/10150/fd/0
[user@host]#

Console 1:

[user@host]# echo $$
10150
[user@host]# SET THIS AS NEXT COMMAND THAT YOU CAN EDIT

Browse other questions tagged or ask your own question.