Skip to main content
added 213 characters in body
Source Link
Archemar
  • 32.3k
  • 18
  • 75
  • 107

ifIf you know relative filename of intermediate file, try

tar -xf $1 -O path/to/file.tar.gz | tar xf - 

where

 -O, --to-stdout Extract files to standard output. 
  1. you might need -z flag in second tar

  2. please note that - is synonym for stdin, maybe that what you meant (tar -xf $1 | tar -xf xargs (*) ) ?

    tar -xf $1 | tar -xf - 

(*) xargs is backquoted


If you feel adventurous, you can also try option --to-command=COMMAND

tar -xf $1 --to-command="tar -xzf -" path/to/file 
  1. I advise to test before going "production"
  2. Do not use absolute path

if you know relative filename of intermediate file, try

tar -xf $1 -O path/to/file.tar.gz | tar xf - 

where

 -O, --to-stdout Extract files to standard output. 
  1. you might need -z flag in second tar

  2. please note that - is synonym for stdin, maybe that what you meant (tar -xf $1 | tar -xf xargs (*) ) ?

    tar -xf $1 | tar -xf - 

(*) xargs is backquoted

If you know relative filename of intermediate file, try

tar -xf $1 -O path/to/file.tar.gz | tar xf - 

where

 -O, --to-stdout Extract files to standard output. 
  1. you might need -z flag in second tar

  2. please note that - is synonym for stdin, maybe that what you meant (tar -xf $1 | tar -xf xargs (*) ) ?

    tar -xf $1 | tar -xf - 

(*) xargs is backquoted


If you feel adventurous, you can also try option --to-command=COMMAND

tar -xf $1 --to-command="tar -xzf -" path/to/file 
  1. I advise to test before going "production"
  2. Do not use absolute path
Source Link
Archemar
  • 32.3k
  • 18
  • 75
  • 107

if you know relative filename of intermediate file, try

tar -xf $1 -O path/to/file.tar.gz | tar xf - 

where

 -O, --to-stdout Extract files to standard output. 
  1. you might need -z flag in second tar

  2. please note that - is synonym for stdin, maybe that what you meant (tar -xf $1 | tar -xf xargs (*) ) ?

    tar -xf $1 | tar -xf - 

(*) xargs is backquoted