On 20 July 2013 at 2:14:06 PM, Mark Hahn ([email protected]) wrote:

Is there anyway to spawn a process running a shell so I can send commands in 
and get results back?  Unlike normal spawn I'd like the process to not exit and 
to keep the shell's environment.  For example I'd like to be able to send these 
to one process one line at a time

x=hello
y=world
echo $x $y

What you want is a pty under unix — to actually allocate a terminal and talk to 
the shell interactively. It’s not trivial, since it becomes mixed error and 
output streams, and it’s more like scripting an interactive session. I question 
the general utility of this if you’re not in some way proxying for a user who’s 
expecting interactivity.

You can manipulate the environment in process and spawn normally to get the 
equivalent of this — more like doing the shell parts yourself, and only 
spawning commands you run — in general, this is a better approach.


—Aria

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to