# Equivalent to exec

**URL:** <https://www.ruby-forum.com/t/equivalent-to-exec/111263>\
**Category:** Rails\
**Created:** [August 4, 2007, 3:50pm UTC](https://www.ruby-forum.com/t/equivalent-to-exec/111263 "2007-08-04T15:50:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pardoengreg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a3d4f5/32.png) [@pardoengreg](https://www.ruby-forum.com/u/pardoengreg)\
**Post date:** [August 4, 2007, 3:50pm UTC](https://www.ruby-forum.com/t/equivalent-to-exec/111263/1 "2007-08-04T15:50:05Z")

</div>

Hi,

Is there an equivalent in RoR of the exec command in PHP ?

Thanks

---

<div class="post-metadata">

**Author:** ![pardoengreg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a3d4f5/32.png) [@pardoengreg](https://www.ruby-forum.com/u/pardoengreg)\
**Post date:** [August 4, 2007, 4:10pm UTC](https://www.ruby-forum.com/t/equivalent-to-exec/111263/2 "2007-08-04T16:10:27Z")

</div>

Grégory Pardoen wrote:

> Hi,
> 
> Is there an equivalent in RoR of the exec command in PHP ?
> 
> Thanks

system(“external\_command”)

or

results = `external_command`

if you want an easy way to capture STDOUT from the command (those are  
backquotes BTW).

–  
Michael W.
