linux - Uncompress tar.gz with appending a suffix to each files name -


i wanted uncompress tar.gz, appending suffix each of file name. so, example abc.tar.gz contains files 'first' , 'second', so, after extracting, if want append suffix '.append'the file name of each files should 'first.append' , 'second.append'. there command or way this?

note: files name 'first' , 'second' there, , wanted decompress without affecting available files.

one thing can think of uncompress in temp dir , then, copy files 1 one. but, wanted in 1 shot, if possible, that, save time.

thanks in advance.

try this:

#!/bin/bash  compress_f=abc.tar.gz  if [ $# -ne 0 ];          compress_f=$1  fi  in `tar -tf "$compress_f"`;  if [ -f $i ];          echo "mv ${i} ${i}.orig"          mv ${i} ${i}.orig  fi  done    in `tar -xvzf "$compress_f"`;          echo "mv ${i} ${i}.append"          mv ${i} ${i}.append          if [ -f ${i}.orig ];                  echo "mv ${i}.orig ${i};"                  mv ${i}.orig ${i};          fi  done


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -