Re: How to write to stdin of another process?
From: Jeremiah DeWitt Weiner (jdw_at_panix.com)
Date: 03/22/05
- Previous message: Ed Morton: "Re: access nth argument list in a file"
- Next in thread: Paul: "How to write to stdin of another process?"
- Reply: Paul: "How to write to stdin of another process?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 22 Mar 2005 15:05:56 +0000 (UTC)
Paul <pg_x@yahoo.com> wrote:
> if I have the PID of another already running process is it possible to write
> to its stdin? I guess it is possible so the question is HOW?
To an arbitrary process, which was not started in any special way?
No. There are ways to do it if you can control how the process starts,
though. For example, you could create a FIFO and make the process take
input from it, then write data to the FIFO. Using "screen" might also
do what you want, depending on what your requirements are.
> I managed to send data to the stdin file of the process and it was displayed
> in the console where the process was running but it wasn't actually read by
> the process :(
Correction: you managed to send data to the terminal which was
stdin and stdout of the process. That's not the same thing as sending
it to the stdin of the process, as you discovered.
Xposted and f'ups set, since this is not really an admin-type question.
JDW
- Previous message: Ed Morton: "Re: access nth argument list in a file"
- Next in thread: Paul: "How to write to stdin of another process?"
- Reply: Paul: "How to write to stdin of another process?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|