# System function respond

**URL:** <https://www.ruby-forum.com/t/system-function-respond/123985>\
**Category:** Ruby\
**Created:** [December 23, 2007, 3:57am UTC](https://www.ruby-forum.com/t/system-function-respond/123985 "2007-12-23T03:57:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavel989](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/48db29/32.png) [@pavel989](https://www.ruby-forum.com/u/pavel989)\
**Post date:** [December 23, 2007, 3:57am UTC](https://www.ruby-forum.com/t/system-function-respond/123985/1 "2007-12-23T03:57:35Z")

</div>

i understand that using system returns a boolean. but how can i get the  
actual output from the system command?

---

<div class="post-metadata">

**Author:** ![pavel989](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/48db29/32.png) [@pavel989](https://www.ruby-forum.com/u/pavel989)\
**Post date:** [December 23, 2007, 4:23am UTC](https://www.ruby-forum.com/t/system-function-respond/123985/2 "2007-12-23T04:23:31Z")

</div>

Pavel P. wrote:

> i understand that using system returns a boolean. but how can i get the  
> actual output from the system command?

Use backticks.

output = `command`

---

<div class="post-metadata">

**Author:** ![pavel989](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/48db29/32.png) [@pavel989](https://www.ruby-forum.com/u/pavel989)\
**Post date:** [December 23, 2007, 5:09am UTC](https://www.ruby-forum.com/t/system-function-respond/123985/3 "2007-12-23T05:09:54Z")

</div>

Tim H. wrote:

> Pavel P. wrote:
> 
> > i understand that using system returns a boolean. but how can i get the  
> > actual output from the system command?
> 
> Use backticks.
> 
> output = `command`

well the thing is that when using system, the output is a boolean bc it  
returns whether the system command executed successfully

---

<div class="post-metadata">

**Author:** ![pavel989](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/48db29/32.png) [@pavel989](https://www.ruby-forum.com/u/pavel989)\
**Post date:** [December 23, 2007, 5:28am UTC](https://www.ruby-forum.com/t/system-function-respond/123985/4 "2007-12-23T05:28:24Z")

</div>

On Dec 22, 2007, at 9:09 PM, Pavel P. wrote:

> well the thing is that when using system, the output is a boolean  
> bc it  
> returns whether the system command executed successfully

stdout = `#{ command }`  
status = $?.exitstatus

for more try

gem install session  
gem install open4

etc.

a @ [http://codeforpeople.com/](http://codeforpeople.com/)

---

<div class="post-metadata">

**Author:** ![pavel989](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/48db29/32.png) [@pavel989](https://www.ruby-forum.com/u/pavel989)\
**Post date:** [December 23, 2007, 5:43am UTC](https://www.ruby-forum.com/t/system-function-respond/123985/5 "2007-12-23T05:43:56Z")

</div>

ara.t.howard wrote:

> On Dec 22, 2007, at 9:09 PM, Pavel P. wrote:
> 
> > well the thing is that when using system, the output is a boolean  
> > bc it  
> > returns whether the system command executed successfully
> 
> stdout = `#{ command }`  
> status = $?.exitstatus
> 
> for more try
> 
> gem install session  
> gem install open4
> 
> etc.
> 
> a @ [http://codeforpeople.com/](http://codeforpeople.com/)

other way around (unless im wrong). i want the output rather then the  
exit status. i tried this out but it still gave me only the exti status

---

<div class="post-metadata">

**Author:** ![pavel989](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/48db29/32.png) [@pavel989](https://www.ruby-forum.com/u/pavel989)\
**Post date:** [December 23, 2007, 10:00am UTC](https://www.ruby-forum.com/t/system-function-respond/123985/6 "2007-12-23T10:00:10Z")

</div>

Pavel P. wrote:

> well the thing is that when using system, the output is a boolean […]

DON’T use system. Use backticks.

---

<div class="post-metadata">

**Author:** ![pavel989](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/48db29/32.png) [@pavel989](https://www.ruby-forum.com/u/pavel989)\
**Post date:** [December 23, 2007, 9:17pm UTC](https://www.ruby-forum.com/t/system-function-respond/123985/7 "2007-12-23T21:17:35Z")

</div>

Sebastian H. wrote:

> Pavel P. wrote:
> 
> > well the thing is that when using system, the output is a boolean […]
> 
> DON’T use system. Use backticks.

i finally realized that a backtick is a `. sorry amd thank you very  
much
