From: Dinesh Umanath Date: 2006-05-03T12:22:16+09:00 Subject: Re: Calling Shell Scripts from Ruby ? Hi Edwin, Thanks for your reply. When you say output = `Unix command`, i did not get about how exactly to use it, is it possible to give a simple sample examples if you have with you which calls a script ?? Oh..so u mean from shell script we can't get the return values to ruby. My requirement is that from "Rails" through the web i will call some shell script and finally the script should return me a "String" value. is that not possible from ruby? Thank You Dinesh Edwin van Leeuwen wrote: >> 1)Is it possible to call "Shell Scripts" from ruby? Say if i have a >> shell sciprt named "test.sh", how can i call this from ruby? Also if i >> can call like that,is it possible to get the output of that script >> passed back to ruby? >> >> 2)How can i call any "Unix command" residing from a ruby program?? > 1 and 2. I always use > output = `Unix command` > > You can also use Kernel.system, but I don't think that will return your > output > http://www.ruby-doc.org/core/classes/Kernel.html#M002992 -- Posted via http://www.ruby-forum.com/.