From: John Smith Date: 2009-12-30T22:06:22+09:00 Subject: Re: How to run one script from another, and capture the output Gary Wright wrote: > On Dec 29, 2009, at 8:11 PM, John Smith wrote: > >> 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 Thanks so much for that! One more quick question. If distance_traveled.rb sits in a different directory than the current script that's calling it, how would I specify it? For example, say it is in ~project/lib/distance_traveled.rb Thanks again! -- Posted via http://www.ruby-forum.com/.