[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: How to execute an external program - Ruby equivalents to PHP?

Logan Capaldo

8/5/2006 7:23:00 PM


On Aug 5, 2006, at 3:12 PM, tesla wrote:

> PHP has these:
>
> shell_exec -- Execute command via shell and return the complete
> output as a
> string
> system -- Execute an external program and display the output
> passthru -- Execute an external program and display raw output
> exec -- Execute an external program
>
> And a few more that I don't use. Does Ruby have equivalents? I am
> especially
> intersted in a shell_exec counterpart.
>
> thanks

backticks:

result = `echo Hello World!`


2 Answers

Matt Todd

8/5/2006 8:38:00 PM

0

There are a few others, like #system (I believe). Check out the
documentation for Kernel.

M.T.

Martin DeMello

8/5/2006 8:48:00 PM

0

On 8/6/06, Matt Todd <chiology@gmail.com> wrote:
> There are a few others, like #system (I believe). Check out the
> documentation for Kernel.

check popen3 out as well

martin