in reply to Creating Tarballs in a perl scripts
First of all: Do you really want the outout of tar?
If not you should not use backticks but system.
Then it all depends on what your variables acually contain as the string you use inside the backticks will be interpreted by a shell.
If for example your $DEST variable contains "/tmp/*" then it is clear why no hidden files make it to the tar-archive - the shell globs "*" and will not pass any hidden files to tar.
The shell used in backticks is usually /bin/sh (not bash - bash-settings are irrelevant here).
If your $DEST does not contain shell meta-characters then I cannot see any reason why your command should not work, but that would not be a Perl-related problem.
Finallly if you use system you can avoid a shell by calling it like
system("/bin/tar", "-cfz", $output_file, $directory)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Creating Tarballs in a perl scripts
by Lotus1 (Vicar) on Jun 11, 2012 at 19:39 UTC | |
by rovf (Priest) on Jun 12, 2012 at 08:36 UTC | |
Re^2: Creating Tarballs in a perl scripts
by mdw1982 (Initiate) on Jun 12, 2012 at 16:54 UTC | |
by morgon (Priest) on Jun 12, 2012 at 17:48 UTC |
In Section
Seekers of Perl Wisdom