From: Ken Mitchell Date: 2007-04-18T00:07:38+09:00 Subject: Re: exec with string in variables? --=-OB4/qILhJuxlnbAAIAJY Content-Type: text/plain Content-Transfer-Encoding: 7bit Try exec("#{exe_path dti.exe -qb -t -eline #{dom_file} #{train_file} #{modell_string} #{line} .dti") Ruby needs #{variable} in quotes to parse variable. Or you could concatenate outside the quotes like: exec(exe_path + "dti.exe -qb......" + dom_file) Basically, it is variable + "string" + another_variable On Tue, 2007-04-17 at 23:55 +0900, Christian wrote: > Hi, > > i have something like this and more in perl and would transform it to > ruby. > First i changed system to exec and than the points to plus , but the > strings which are in the scalar's seems > not be applied in the exec call , perhaps some special needs with > quoting!? > > > :perl > foreach $line(@methoden) { > system("$exe_path" . "dti.exe -qb -t -e$line $dom_file > $train_file $modell_string" . "$line" . ".dti"); > ................. > } > > :ruby > > methoden.each do |line| > exec("exe_path + dti.exe -qb -t -eline dom_file train_file > modell_string + line + .dti") > ............. > end > > many thanks christian > > > -- Thanks, Ken Mitchell Wireless Operations Engineer Farmers Wireless CONFIDENTIALITY NOTICE: This e-mail and any attachment to it may contain confidential and legally privileged information. This information is intended only for the recipient named above. If you are not the intended recipient, take notice that any disclosure, copying, distribution or taking of any action based upon this information is prohibited by law. If you have received this e-mail in error, please return it to the sender and delete this copy from your system. Thank you. --=-OB4/qILhJuxlnbAAIAJY--