in reply to Re^2: tar, system() & pipes?
in thread tar, system() & pipes?
I think the following is safe on unix platforms:
my $q_archive = quotemeta($ARGV); my $q_filename = quotemeta($filename); system("tar $args $q_archive > $q_filename")
It can also be written as
system("tar $args \Q$ARGV\E > \Q$filename\E")
quotemeta (called directly or via \Q..\E) will backslash-escape any non-word characters, so the file names can safely contain symbols and spaces.
|Replies are listed 'Best First'.|
Re^4: tar, system() & pipes?
by Anonymous Monk on Jul 17, 2007 at 20:55 UTC
by Argel (Prior) on Jul 17, 2007 at 22:11 UTC
In Section Seekers of Perl Wisdom