[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

starting another programs from inside.

jabowen

8/20/2007 3:42:00 PM

I searched ruby-talk but I could not find the answer.
I want to start one program from inside another.

test.rb
puts 'hi'

test1.rb
`test.rb`

test1.rb results => Exec format error - test.rb
(Errno::ENOEXEC)

Thanks
Jeff



____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase....

3 Answers

Michael Glaesemann

8/20/2007 3:51:00 PM

0


On Aug 20, 2007, at 10:41 , Jeffrey Bowen wrote:

> test1.rb
> `test.rb`
>
> test1.rb results => Exec format error - test.rb
> (Errno::ENOEXEC)

I think you need to make test.rb executable, which is what
Errno::ENOEXEC is telling you.

Michael Glaesemann
grzm seespotcode net



Stefano Crocco

8/20/2007 3:57:00 PM

0

Alle lunedì 20 agosto 2007, Michael Glaesemann ha scritto:
> On Aug 20, 2007, at 10:41 , Jeffrey Bowen wrote:
> > test1.rb
> > `test.rb`
> >
> > test1.rb results => Exec format error - test.rb
> > (Errno::ENOEXEC)
>
> I think you need to make test.rb executable, which is what
> Errno::ENOEXEC is telling you.
>
> Michael Glaesemann
> grzm seespotcode net

Or you can use

`ruby test.rb`

Of course, this assumes that the ruby executable is actually called ruby. By
the way, using the backtick syntax, the output of the executed program is not
displayed on the screen, but is returned as a result of the `` method call.
If you the output from the executed program to be displayed, you can use the
system method.

Stefano

Ari Brown

8/20/2007 5:50:00 PM

0


On Aug 20, 2007, at 11:41 AM, Jeffrey Bowen wrote:

> I searched ruby-talk but I could not find the answer.
> I want to start one program from inside another.
>
> test.rb
> puts 'hi'
>
> test1.rb
> `test.rb`
>
> test1.rb results => Exec format error - test.rb
> (Errno::ENOEXEC)

load "test.rb"
or
require "test.rb"
-------------------------------------------------------|
~ Ari
crap my sig won't fit