From: Suraj Kurapati Date: 2007-07-24T13:19:36+09:00 Subject: Re: Calling a Perl script from Ruby 12 34 wrote: > Answering own question: > > gpxFiles = gpxDateFN.join("\" \" ") > `perl \"#{gpsPhotoLoc}\" --dir \"#{destPhoto}\" --gpsfile > \"#{gpxFiles}\" --timeoffset #{timeOffset}` > > All the double quotes are needed because the file names have spaces in > them, and gpxFiles is a list of file names with a space in between each > item. Rather ugly solution. class String # Transforms this string into an escaped POSIX shell argument. def shell_escape inspect.gsub(/\\(\d{3})/) {$1.to_i(8).chr} end end > Open to suggestions on getting a string list > from an array with double quotes around each item and a space between > each item. your_array.map {|s| s.shell_escape}.join(' ') -- Posted via http://www.ruby-forum.com/.