Hi,
Below is the description of my problem.
I am trying to loop through the below file names sitting in the file - FileNames.txt, and trying to decompress them
FileNames.txt
filename="20150408_MGAC_[0-9][0-9][0-9][0-9].txt.gz"
But when I use the below command -
I get the output file name like this -
How can I format the output file name to something like the below?
I have tried multiple options while extracting the files but I am not able to get the desired result.
Please help.
Below is the description of my problem.
I am trying to loop through the below file names sitting in the file - FileNames.txt, and trying to decompress them
FileNames.txt
Code:
20150408_MGAC_[0-9][0-9][0-9][0-9].txt.gz
20150408_MGCC_[0-9][0-9][0-9][0-9].txt.gz
20150408_MGSH_[0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9].txt.gz
20150408_MGSL_[0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9].txt.gz
But when I use the below command -
Code:
gzip -c ${filename} > ${filename%.*}
Code:
20150408_MGAC_[0-9][0-9][0-9][0-9].txt
Code:
20150408_MGAC_1111.txt
20150408_MGCC_1111.txt
20150408_MGSH_1111_1111.txt
20150408_MGSL_1111_1111.txt
Please help.