in reply to Re: Tar GZip Question
in thread Tar GZip Question
to:Err no. You're right he doesn't need to escape the dots of course, but his system LIST form avoids the shell, yours doesn't.
system("/usr/bin/mv ./katt0$number.tar.gz ../html/img/katt0$number.tar.gz");
rename("$tarball", "../html/img/$tarball");
That is usually better, but don't forget to mention the caveat that mv(1) will work across filesystem boundaries and rename won't. File::Copy is what you usually want when you're using rename. (Oh, and why the quotes around $tarball?)
Playing with $ENV{PWD} does not do anything other than confuse yourself - it doesn't actually change the working directory. You either want to actually chdir or (as I posted above) use the -C option to tar.
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^2: Tar GZip Question
by l2kashe (Deacon) on Oct 30, 2002 at 20:11 UTC | |
by Aristotle (Chancellor) on Oct 30, 2002 at 21:39 UTC |