From: Joel VanderWerf Date: 2006-10-25T03:35:56+09:00 Subject: Re: backquote and variables Joel VanderWerf wrote: > robertlaferla@comcast.net wrote: >> I am trying to construct a command line to be executed using backquote >> `` notation. i.e. capturing the output to a string >> >> e.g. >> >> #!/usr/bin/ruby -w >> file = "/etc/motd" >> string = `"cat " + file` > > > string = `#{"cat "} + file` Oops, I didn't really read your example. I assumed you were trying to get the command name interpolated in the string. Wilson answered your question. If you wanted to interpolate both, you could do this: cmd="cat" file="/etc/motd" motd = `#{cmd} #{file}` -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407