From: Gary Wright Date: 2009-12-30T13:43:18+09:00 Subject: Re: How to run one script from another, and capture the output On Dec 29, 2009, at 8:11 PM, John Smith wrote: > I have the following hypothetical script that requires arguments to run. > The command line execution looks like this: > > 'ruby distance_traveled.rb 60 2.5' > > The output would be the following: > > 'You have traveled a distance of 150 miles.' > > > How would I run the above execution from inside another script, and > capture the output above (the 150 miles portion at least)? output = `ruby distance_traveled.rb 60 2.5` The backticks cause the standard output of the command to be captured and stored in a Ruby string. Gary Wright