rubygems - Interaction with shell through Ruby continuously? -


i want capture output shell commands using

response = `#{command}` 

which fine if want run 1 command , not continuous interaction. instance if do

response = `cd tmp` # response = '', correct response = `ls` 

i return ls within tmp, since in previous command had changed directory temp. there way run continuous shell on own thread or gem or effect?

the ` starts sub-shell, not affect current ruby shell. can use ruby's dir.chdir or fileutils.cd change working directory of ruby shell.

btw, maybe fresh, hybrid between system , ruby shell. can use cd/ls there, while being in ruby shell.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -