# System() Function

**URL:** <https://discuss.rubyonrails.org/t/system-function/57444>\
**Category:** rubyonrails-talk\
**Created:** [February 21, 2011, 2:06am UTC](https://discuss.rubyonrails.org/t/system-function/57444 "2011-02-21T02:06:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nop](https://avatars.discourse-cdn.com/v4/letter/n/48db29/32.png) [@Nop](https://discuss.rubyonrails.org/u/Nop)\
**Post date:** [February 21, 2011, 2:06am UTC](https://discuss.rubyonrails.org/t/system-function/57444/1 "2011-02-21T02:06:19Z")

</div>

Hi,

I'm new to RoR and to begin I decided to do a graphic calculator as my second project. I plan to use octave to evaluate the expressions, I can't get to install the octave-ruby gem and for the sake of development speed I'll be fetching the ouput of "octave --eval" instead. I found that ruby uses the same command as php to run external commands, system(), but whether i use system("octave","/usr/bin") or system("octave"), it will return "true", telling me that the application was successfully executed. I can't convert the output to string, either.

What are your recommendations to grab the output from an application?

MK

---

<div class="post-metadata">

**Author:** ![Michael\_Pavling](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@Michael\_Pavling](https://discuss.rubyonrails.org/u/Michael_Pavling)\
**Post date:** [February 21, 2011, 8:57am UTC](https://discuss.rubyonrails.org/t/system-function/57444/2 "2011-02-21T08:57:38Z")

</div>

An alternative method of calling system commands is the back-tick - on my keyboard, it's on the key above tab, next to "1". As an example, I have used it to return the value of a mount command to see whether a particular mount point is attached:

device\_path = `mount | grep /media/backups`.split(" ").first

HTH
