Reputation: 664
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
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