From: Michael Neumann Date: 2001-10-26T03:38:09+09:00 Subject: [ruby-talk:23330] Re: Newbie seeks %x{...} help Brian Baker wrote: > I am trying to dynamically generate commands as strings > and then execute them in Ruby and collect the output. > However Ruby treats the specified command literally, > so if I build a command with > > command = "echo test" > result = `command` > You can substitute any expression in back tick strings as you can do in "normal" strings using #{ expression }. command = "echo test" result = `#{ command }` But you can also use method system: command "echo test" result = system(command) Regards, Michael -- Michael Neumann merlin.zwo InfoDesign GmbH http://www.merlin-zwo.de