On Sat, 2 Mar 2019 17:20:34 +0000, Sasso, Len wrote:
>
>I want to use either the PAX Command or the TAR command to extract a file from 
>a TAR file and place it in the current directory.
>
>       Details:
>       Name of TAR File: Test.tar
>       Name of file to be Extracted (including path within the Tar file):  
> /epf-zip4natl/z4trans/z4trans.zip
> 
Ummm... Your supplier archived a fully-qualified directory name.  That's
discourteous; it complicates extraction.

>       Current folder: /MyFolder
> 
And you're working in a root-level directory?  That's surprising.

>       Expected Result: /MyFolder/z4trans.zip
>
>Any help you could provide would be greatly appreciated.
> 
I tested the following, avoiding fully-qualified paths.  Hammer and file to fit:

582 $ pax -r -s#epf-zip4natl/z4trans#MyFolder# -vv '*/*/z4trans.zip' <Test.tar
-rw-r--r--  1 paulgilm paulgilm        29 Mar  2 10:39 MyFolder/z4trans.zip
pax: ustar vol 1, 4 files, 10240 bytes read, 0 bytes written.
583 $ 
583 $ ls -al My*
total 12
drwxr-xr-x 2 paulgilm paulgilm 4096 Mar  2 10:59 .
drwxr-xr-x 4 paulgilm paulgilm 4096 Mar  2 10:59 ..
-rw-r--r-- 1 paulgilm paulgilm   29 Mar  2 10:39 z4trans.zip
584 $ 

See:
    
https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.bpxa500/r4paxsh.htm

-- gil

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

Reply via email to