From: Brian Adkins Date: 2007-10-14T10:40:03+09:00 Subject: Re: backquotes question On Oct 13, 8:28 pm, 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. I think the syntax is great, but you can also use the following: puts Kernel::`("ls") Still uses a backquote, but it's more like a traditional method call. Or as described on p. 351 of the pickaxe, you can alias the backquote: alias :cmd :` puts cmd "ls" This worked for me when running a program, but not from irb. But if you give it some time, I think you may like the simplicity of: result = `ls`