On Tue, Jan 10, 2017 at 11:12 AM, R.S. <[email protected]>
wrote:

> The following scenario:
> pax archive created in some directory, let's say /aaa/bbb (many files and
> subdirectories here)
> the resulting archive is /TEST.pax
>
> I'm able to restore the archive using the following command:
> pax -r -peW -f /TEST.pax
>
> However the command above restores the archive in a *current directory*.
> I want to provide a target directory as a command parameter, like
> pax -r -peW -f /TEST.pax -some-magic-option:/yyy/target/dir
>
> Of course I can (and I do) "cd /yyy/target/dir" before pax -r, but I can't
> believe it's the only option to skin the cat.
>
> Any clue?
>

​You only want a clew (older English)? The clew is: look at the -s
parameter. And think strangely.



>
> --
> Radoslaw Skorupka
> Lodz, Poland
>


​OK, I'll be nice. Try the command:

pax -r -peW -​s#^#/yyy/target/dir/# -f /TEST.pax

You might want to use a "-l" before doing a "-r" just to see what "pax"
will actually do. Basically the -s will "prepend" (the ^ is bregexp for
"before start of string") the string "/yyy/targfet/dir/" to the front of
whatever is in the pax. Make sure to include the trailing / in the
directory of things likely won't work correctly.


-- 
There’s no obfuscated Perl contest because it’s pointless.

—Jeff Polk

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to