Running a system command

how do i run a system command in ruby

in php it is exec(“commandhere”);

what is the ruby equivalent

very newbie wrote:

how do i run a system command in ruby

in php it is exec(“commandhere”);

what is the ruby equivalent

system(“commandhere”)

Tim H. wrote:

very newbie wrote:

how do i run a system command in ruby

system(“commandhere”)

thanks that was it

On 6/14/06, qubit qubit [email protected] wrote:

how do i run a system command in ruby

in php it is exec(“commandhere”);

what is the ruby equivalent

Please remember to look in the various information sources that exist
before asking a simple question like this. This could have been
Googled pretty easily. You are posting to a mailing list, not a mere
web forum.

-austin

Tim H. wrote:

commandhere will return the output:

irb(main):001:0> ls -alt
=> “total 8\ndrwxrwxr-x 2 justinc justinc 4096 Jun 14 12:55
.\n-rw-rw-r-- 1 justinc justinc 0 Jun 14 12:55
another\n-rw-rw-r-- 1 justinc justinc 0 Jun 14 12:55
file\n-rw-rw-r-- 1 justinc justinc 0 Jun 14 12:55
afile\ndrwxr-xr-x 59 justinc justinc 4096 Jun 14 11:13 …\n”

Also, please checkout http://ruby-doc.org/ and especially
module Kernel - RDoc Documentation

-Justin