Run a command on shell with ruby

hi guys,

i want to run a command with a ruby programme. for example, assume that
i have a ruby script and when run its, it make "apt-get install gaim"
command run..

what is the method or way of that ?
thanks

···

--
Posted via http://www.ruby-forum.com/.

ok i got it. and i am giving an example for who want to know

#! /usr/bin/ruby
exec "apt-get install gaim";

this script run that command on shell

Corpus Callosum wrote:

···

hi guys,

i want to run a command with a ruby programme. for example, assume that
i have a ruby script and when run its, it make "apt-get install gaim"
command run..

what is the method or way of that ?
thanks

--
Posted via http://www.ruby-forum.com/\.

system "apt-get install gaim"

I'd recommend using pidgin -- it's the newest release of gaim.

TwP

···

On 5/19/07, Corpus Callosum <pythagorasthales@yahoo.com> wrote:

hi guys,

i want to run a command with a ruby programme. for example, assume that
i have a ruby script and when run its, it make "apt-get install gaim"
command run..

what is the method or way of that ?
thanks

Corpus Callosum wrote:

hi guys,

i want to run a command with a ruby programme. for example, assume that
i have a ruby script and when run its, it make "apt-get install gaim"
command run..

what is the method or way of that ?
thanks

Use the Kernel#system method, or surround the command with backticks.

system("apt-get install gaim")
`apt-get install gaim`

···

--
RMagick [http://rmagick.rubyforge.org]
RMagick Installation FAQ [http://rmagick.rubyforge.org/install-faq.html\]

system?
http://www.ruby-doc.org/core/classes/Kernel.html#M005960

···

On 5/19/07, Corpus Callosum <pythagorasthales@yahoo.com> wrote:

hi guys,

i want to run a command with a ruby programme. for example, assume that
i have a ruby script and when run its, it make "apt-get install gaim"
command run..

what is the method or way of that ?
thanks

--
Felipe Contreras

Do you mean like this:

<http://www.rubycentral.com/book/tut_expressions.html#UA&gt;

?

m.

···

Corpus Callosum <pythagorasthales@yahoo.com> wrote:

hi guys,

i want to run a command with a ruby programme. for example, assume that
i have a ruby script and when run its, it make "apt-get install gaim"
command run..

what is the method or way of that ?

--
matt neuburg, phd = matt@tidbits.com, Matt Neuburg’s Home Page
Tiger - http://www.takecontrolbooks.com/tiger-customizing.html
AppleScript - http://www.amazon.com/gp/product/0596102119
Read TidBITS! It's free and smart. http://www.tidbits.com

Hey guys are there any web search api's that are ruby friendly?

for posterity, this does run through the shell, rather it replaces ruby with the argument to exec (another process) completely by-passes the shell. you need to use system or popen to utilize the shell.

regards.

-a

···

On May 19, 2007, at 2:23 PM, Corpus Callosum wrote:

ok i got it. and i am giving an example for who want to know

#! /usr/bin/ruby
exec "apt-get install gaim";

this script run that command on shell

--
we can deny everything, except that we have the possibility of being better. simply reflect on that.
h.h. the 14th dalai lama

Please do not thread-hijack. You should create a new message rather
than changing the subject line unless the new subject has something to
do with the original discussion.

···

On May 19, 5:21 pm, Gian Holland <gia...@gmail.com> wrote:

Hey guys are there any web search api's that are ruby friendly?

Gian,

maybe this describes what you're looking for:

http://www.rubyrailways.com/data-extraction-for-web-20-screen-scraping-in-rubyrails

Best regards,

Axel

···

--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

My apologies it was done inadvertently.

Gregory Brown wrote:

···

On May 19, 5:21 pm, Gian Holland <gia...@gmail.com> wrote:
  

Hey guys are there any web search api's that are ruby friendly?
    
Please do not thread-hijack. You should create a new message rather
than changing the subject line unless the new subject has something to
do with the original discussion.