starting another programs from inside.

J

Jeffrey Bowen

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.yahoo.com/
 
M

Michael Glaesemann

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
 
S

Stefano Crocco

Alle luned=EC 20 agosto 2007, Michael Glaesemann ha scritto:
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. B=
y=20
the way, using the backtick syntax, the output of the executed program is n=
ot=20
displayed on the screen, but is returned as a result of the `` method call.=
=20
If you the output from the executed program to be displayed, you can use th=
e=20
system method.

Stefano
 
A

Ari Brown

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top