From: Tim Hunter Date: 2007-10-14T09:44:43+09:00 Subject: Re: backquotes question Zouplaz wrote: > Hello, I would like to know why > cmd = "/bin/df -H /dev/#{partition}" > used = `#{cmd}` > > works fine but this fails > used = `"/bin/df -H /dev/#{partition}"` > > with an OS error. > > Thank you > > BTW, is there an aliase to the backquote ? I mean a kernel method doing > the same - Just for the syntax, backquotes are not very sexy. > You don't need the quotes when you surround the command with backquotes. Use this instead: used = `/bin/df -H /dev/#{partition}` When you use both quotes and backquotes, the quotes are treated as part of the command. That's what causes the error. You can use %x instead of backquotes: used = %x(/bin/df -H /dev/#{partition}) -- RMagick OS X Installer [http://rubyforge.org/projects/rmagick/] RMagick Hints & Tips [http://rubyforge.org/forum/forum.php?forum_id=1618] RMagick Installation FAQ [http://rmagick.rubyforge.org/install-faq.html]