System commands

Let me first apologize I asked this question last week
and lost the answer. How do I run Linux commands in
side a ruby program? I’ll print it out this time.

Thanks
Jeff

using system() or backticks ``

cmd = uptime
puts cmd

On 7/16/07, Jeffrey B. [email protected] wrote:

Let me first apologize I asked this question last week
and lost the answer. How do I run Linux commands in
side a ruby program? I’ll print it out this time.

Michael answered your question, but to help you find old posts next time
around:
http://blade.nagaokaut.ac.jp/ruby/ruby-talk/index.shtml

I have a line like this:

response = <some command>

Why might it be that response is only NIL when that command is run
through a rake task initiated by cron? If i just run the rake task
normally it works fine.

Gregory B. wrote:

On 7/16/07, Jeffrey B. [email protected] wrote:

Let me first apologize I asked this question last week
and lost the answer. How do I run Linux commands in
side a ruby program? I’ll print it out this time.

Michael answered your question, but to help you find old posts next time
around:
http://blade.nagaokaut.ac.jp/ruby/ruby-talk/index.shtml