From: Derek Smith Date: 2009-08-14T08:46:49+09:00 Subject: Re: move a file 7stud -- wrote: > Bertram Scharpf wrote: >> Hi, >> >> Am Donnerstag, 13. Aug 2009, 10:48:10 +0900 schrieb Derek Smith: >>> >>> ruby /tmp/test >>> /tmp/test:8: syntax error, unexpected ')', expecting kDO_BLOCK >>> >>> FileUtils.mv("#{file}.copied",ZIPDIR"#{file}.tst") >> ^^^ >> >> Try it with something like (untested) >> >> "#{ZIPDIR}/#{file}.tst" >> File.join ZIPDIR, "#{file}.tst" >> >> Syntax errors are the easiest to solve. >> >> Bertram > > So in this line: > > ZIPDIR"#{file}.tst" > > you determined that you needed to use string interpolation for the > variable file, but because ZIPDIR is capitalized, you didn't think > string interpolation was necessary for that variable, and instead you > just wrote the variable next to the string? This was what did it! Thank you Sir! file="dev.log" FileUtils.cp("#{file}", "#{file}.copied") ZIPDIR = "/usr/local/" FileUtils.mv("#{file}.copied","#{ZIPDIR}#{file}.ts -- Posted via http://www.ruby-forum.com/.