# System Commands in Web App

**URL:** <https://www.ruby-forum.com/t/system-commands-in-web-app/108943>\
**Category:** Rails\
**Created:** [July 9, 2007, 8:09pm UTC](https://www.ruby-forum.com/t/system-commands-in-web-app/108943 "2007-07-09T20:09:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rawn027](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@rawn027](https://www.ruby-forum.com/u/rawn027)\
**Post date:** [July 9, 2007, 8:09pm UTC](https://www.ruby-forum.com/t/system-commands-in-web-app/108943/1 "2007-07-09T20:09:34Z")

</div>

How would I go about calling system commands in a web app?  
Does anyone have any source available that I can look at?

Thanks!

---

<div class="post-metadata">

**Author:** ![rawn027](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@rawn027](https://www.ruby-forum.com/u/rawn027)\
**Post date:** [July 9, 2007, 10:45pm UTC](https://www.ruby-forum.com/t/system-commands-in-web-app/108943/2 "2007-07-09T22:45:05Z")

</div>

Ron Mr. wrote:

> How would I go about calling system commands in a web app?  
> Does anyone have any source available that I can look at?
> 
> Thanks!

Try just using the ‘backticks’ around your commands and trapping the  
results.

Ex: result = `ps -aef`

But keep in mind you hold up your request while it’s processing. If you  
need something a bit more robust create a queue, have a thread process  
the queue and put results into a a DB. The you can a monitoring page  
(maybe using AJAX) To get the results/status for your processes.
