0

I have the following problem, I have to build a rails app which executes some script on my server machine and retrieves the output showing it to the user....I thought so, I create in my root app directory a directory called 'script' and I insert all my scripts, now how can I execute them and retrieve the output? Thank you

P.S. Which linguage my scripts have to be written in to be executed?

zer0uno
  • 7,521
  • 13
  • 57
  • 86
  • possible duplicate of [Calling Bash Commands From Ruby](http://stackoverflow.com/questions/2232/calling-bash-commands-from-ruby) – zwippie Sep 23 '13 at 08:06

1 Answers1

1

Use back quotes ` like this:

@script_output = `my_script_path`

Ruby starts a new process, executes the script and returns the output

Rajesh Kolappakam
  • 2,095
  • 14
  • 12