# Starting another programs from inside

**URL:** <https://www.ruby-forum.com/t/starting-another-programs-from-inside/112528>\
**Category:** Ruby\
**Created:** [August 20, 2007, 5:42pm UTC](https://www.ruby-forum.com/t/starting-another-programs-from-inside/112528 "2007-08-20T17:42:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rorjeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9e5f3/32.png) [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Post date:** [August 20, 2007, 5:42pm UTC](https://www.ruby-forum.com/t/starting-another-programs-from-inside/112528/1 "2007-08-20T17:42:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rorjeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9e5f3/32.png) [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Post date:** [August 20, 2007, 5:52pm UTC](https://www.ruby-forum.com/t/starting-another-programs-from-inside/112528/2 "2007-08-20T17:52:41Z")

</div>

On Aug 20, 2007, at 10:41 , Jeffrey B. 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 G.  
grzm seespotcode net

---

<div class="post-metadata">

**Author:** ![rorjeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9e5f3/32.png) [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Post date:** [August 20, 2007, 5:57pm UTC](https://www.ruby-forum.com/t/starting-another-programs-from-inside/112528/3 "2007-08-20T17:57:41Z")

</div>

Alle lunedì 20 agosto 2007, Michael G. ha scritto:

> Michael G.  
> 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

---

<div class="post-metadata">

**Author:** ![rorjeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9e5f3/32.png) [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Post date:** [August 20, 2007, 7:50pm UTC](https://www.ruby-forum.com/t/starting-another-programs-from-inside/112528/4 "2007-08-20T19:50:55Z")

</div>

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

> (Errno::ENOEXEC)  
> load “test.rb”  
> or  
> require “test.rb”  
> -------------------------------------------------------|  
> ~ Ari  
> crap my sig won’t fit
