I'm having a little trouble understanding what's happening in a Perl script that uses pax.
Background: Feeding a .tgz file to pax and unpacking to get a folder full of files.
This is the thing I don't understand:
pax -r -z -s '/.*\\//directory\\//p' -f $input_path/$tgz
Where $input_path is a scalar variable in Perl containing a path and $tgz is another scalar variable containing the name of the .tgz file.
So -r for reading makes sense, -z for unzipping is fine. The -s and -f flags confuse me. I get the following error:
pax: Invalid replacement string option /.*\\//directory\\//p.
How I think the flags work:
-f, as this doesn't seem to be the problem. This is just where to put the files.
-s, string replacement to modify the names of the file contained in the .tgz file.
Can anyone demystify the /.*\\//directory\\//p part, as I don't really get what's going on here with all the escape slashes, \ and the p must do something but I have no idea what?