If you want to run a command and gather it’s output from stdout,
enclosing the command in backticks will do it, i.e.
ls. If you want to
run a command, but you don’t care about any output on stdout, instead
you just want to know if the command was found and ran successfully,
system is what you want, i.e. system(“ls”) . System returns true if the
command is found and ran successfully, false otherwise.
Brent B. wrote:
Sorry if this is the wrong list. Ive been reading up on ruby with the
ruby cookbook and cant seem to find out how to call an externel process
via rails web form. Im running ruby on rails on linux and need to call a
externel process that will execute a command from my web app. Any
pointers would be appreciated thanks.