string - Extracting a .tar file and creating a filelist -
i have little code here
file in *.tar.gz; tar xzvf "${file}" && rm "${file}"; done
it extracts tar.gz , deletes it. have create filelist file (.fl) named substring .tar . example, have delete first 5 letters , last 5 (the extension) name of .tar.gz . , every .tar.gz extract.
example:
- i have abc_a.tar.gz abc_a.xml in it.
- i have make a.fl , in a.fl have write abc_a.xml
thanks in advance.
in loop, can following each file:
# delete first 5 characters name=${file:5} # delete .tar.gz suffix name=${file%%.tar.gz}
Comments
Post a Comment