From: Bikas De simex Date: 2008-10-03T00:49:31+09:00 Subject: Re: Remotely passing value on system() or %x[] Bikas De simex wrote: > Stefano Crocco wrote: >> Alle Thursday 02 October 2008, Bikas De simex ha scritto: >>> > Are you aware that string interpolation doesn't happen in single quoted >>> > which, I guess, is what you want. To achieve this, you need to use a >>> following: >>> Thanks in advance. >> The third line should work. To be sure the falut is of missing >> interpolation, >> I'd suggest to break the call to system in two steps: first, build the >> command >> string, then call puts. While this shouldn't affect the result, it >> allows you >> to see which is the command you're going to execute with system. You can >> do >> something like this: >> >> cmd = "plink -pw ppp xxx@yyyy /tmp/essai.ksh #{dirc[3]}" >> puts cmd >> system(cmd) >> >> What's the output from the lines above? >> >> Stefano > > Hi, > > I have got: > >>ruby veilleur0.rb > > PTOTO -----------> This is done by puts "#{dirc[3]}\n"<--- > /tmp/mma/essai.ksh[36]: syntax error at line 214 : `"Nous traitons le > batch $BATH ...n"' unexpected > Le batch trait辿 est > > .......................... > > We do not have interpolation on system() since $BATH will be replace by > the value PTOTO. > > Thanks a lot Hi, It was my remote script that was wrong. Interpolation work. system("plink -pw ppp xxx@yyyy /tmp/essai.ksh #{dirc[3]}") work ....! Thanks again -- Posted via http://www.ruby-forum.com/.