Re: How to write to stdin of another process?

From: Jeremiah DeWitt Weiner (jdw_at_panix.com)
Date: 03/22/05

  • Next message: Kevin Hastie: "Re: using grep and find to search multiple files for strings"
    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


  • Next message: Kevin Hastie: "Re: using grep and find to search multiple files for strings"

    Relevant Pages

    • Re: How to write to stdin of another process?
      ... > if I have the PID of another already running process is it possible to write ... > I managed to send data to the stdin file of the process and it was displayed ... appropriate to multiple newsgroups, then cross-post. ...
      (comp.unix.misc)
    • How to write to stdin of another process?
      ... >> if I have the PID of another already running process is it possible to ... Those processes still have stdin. ... created especially for them internal pipes: ... since this is not really an admin-type question. ...
      (comp.unix.questions)
    • Re: How to write to stdin of another process?
      ... > if I have the PID of another already running process is it possible to write ... you could create a FIFO and make the process take ... stdin and stdout of the process. ... since this is not really an admin-type question. ...
      (comp.unix.admin)
    • How to write to stdin of another process?
      ... if I have the PID of another already running process is it possible to write ... 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 ...
      (comp.unix.misc)
    • How to write to stdin of another process?
      ... if I have the PID of another already running process is it possible to write ... 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 ...
      (comp.unix.admin)