mr_mariusz
mr_mariusz

Reputation: 664

writing STDIN to process using its PID

I am trying to run GNU octave on one terminal window (window 1) and then send it commands from another (window 2). For example, setting the variable x = 1 from window 2 (possibly using the running instance of octave's PID) and then checking what x is in window 1 through the octave interface. Window 1 is essentially just waiting for a STDIN and I want to provide it from a different window.

I looked for a few hours on how to do this but everything I found tried solving different problems.

I am using the terminal on Mac OS X. My shell is Bash 4.2.

I appreciate any help!

Upvotes: 2

Views: 981

Answers (1)

dspeyer
dspeyer

Reputation: 3036

I can't swear this will work on OSX, but on linux write to /proc/${pid}/fd/0.

Edit: actually this doesn't work. Thanks @KeithThompson

Upvotes: 1

Related Questions