From: "Jörg W Mittag" Date: 2008-01-26T09:39:58+09:00 Subject: Re: Parsing HTML / following links etc Dan Cuddeford wrote: > Stefano Crocco wrote: >> In ruby, you can execute a command in a subshell using the system method >> or >> the backticks (`) operator. This way, you can create a ruby script which >> downloads what you need using wget, then goes on doing whatever you want >> with >> those files. > >> `wget http://www.digg.com -r -l 2` > How to I wack a variable in here? It doesn't seem to want a string :( The backticks operator -- like most other operators in Ruby -- isn't actually an operator, it's a method. In this case, it's a method named '`' that lives on the Kernel module and takes a String as its parameter. So, `wget http://www.digg.com -r -l 2` is actually just syntactic sugar for `("wget http://www.digg.com -r -l 2"). Well, except that's not valid Ruby syntax. But this is: send(:`, "wget http://www.digg.com -r -l 2") So, now that you know that the argument *is*, in fact, a String, you can probably guess what you can do with that String: String Interpolation! `wget #{uri} -r -l 2` jwm