# Browser -\> command line

**URL:** <https://www.ruby-forum.com/t/browser-command-line/107198>\
**Category:** Ruby\
**Created:** [June 19, 2007, 2:14am UTC](https://www.ruby-forum.com/t/browser-command-line/107198 "2007-06-19T02:14:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![goodieboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Post date:** [June 19, 2007, 2:14am UTC](https://www.ruby-forum.com/t/browser-command-line/107198/1 "2007-06-19T02:14:11Z")

</div>

Hi,

I was hoping I could get this done with PHP 5 in a day, but it’s turning  
out  
to be a little more complicated than I thought. Maybe Ruby can do this  
sort  
of thing easier? What I’d like to do is have a browser/web interface  
talk to  
a command line script, that in turn does an svn update on a particular  
directory. I’d also like to be able to get “real-time” output from the  
script. I realize that getting real-time feedback in the browser will  
require ajax. Updating from SVN is only one of the command line tasks I  
have  
to do.

Any ideas on how I can do this?

Any tips/tricks/links much appreciated! 🙂

---

<div class="post-metadata">

**Author:** ![goodieboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Post date:** [June 19, 2007, 5:43am UTC](https://www.ruby-forum.com/t/browser-command-line/107198/2 "2007-06-19T05:43:27Z")

</div>

On Jun 18, 8:12 pm, “Matt M.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Any ideas on how I can do this?

[http://tryruby.hobix.com/](http://tryruby.hobix.com/)

T.

---

<div class="post-metadata">

**Author:** ![goodieboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Post date:** [June 19, 2007, 5:50am UTC](https://www.ruby-forum.com/t/browser-command-line/107198/3 "2007-06-19T05:50:27Z")

</div>

[http://www.ruby-forum.com/topic/111681](http://www.ruby-forum.com/topic/111681)

---

<div class="post-metadata">

**Author:** ![goodieboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Post date:** [June 19, 2007, 6:07am UTC](https://www.ruby-forum.com/t/browser-command-line/107198/4 "2007-06-19T06:07:28Z")

</div>

Hey thanks. I should have worded this much differently. At this point  
I’m  
forgetting about the browser. I know ruby, but don’t have a lot of  
command  
line/IO experience with it. So my question should have been more related  
to  
the IO class. To be more specific, how can do you mange commands,  
command  
status results (successful, failed?) . The basic flow would be, su to  
some  
other user, if password OK, proceed to next command, display error,  
etc…

Feel like showing me a skeleton script that could do something like  
that? 🙂

I’ve been messing with IO.popen, Kernel.system tonight and getting some  
results.

Thanks again.

---

<div class="post-metadata">

**Author:** ![goodieboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Post date:** [June 19, 2007, 4:24pm UTC](https://www.ruby-forum.com/t/browser-command-line/107198/5 "2007-06-19T16:24:54Z")

</div>

`cat #{ __FILE__ }` is a simple example of invoking the command line from  
Ruby.

This has been discussed a LOT.

There are libraries that make sysadmining easy with ruby.

Aur
