Hi Ehsan,

A minor point, to begin with:

> tarfile=file.tar.gz
[...]
> tar cvf "$tarfile" "$file1" "$file2"

Since your file ends in .gz, you probably meant this:

  tar cvfz "$tarfile" "$file1" "$file2"
  
> I want to untar the original file (i.e. file.tzr.gz) and directly gzip
> the untar files (i.e. file1.fastq and file2.fastq) with one command

Ok, here it is:

  tar -vxf file.tar.gz --to-command 'gzip -c > $TAR_FILENAME.gz'

See the following link for details:

http://www.gnu.org/software/tar/manual/html_section/tar_34.html#SEC85

Regards,
Sergey


Reply via email to