I have a script which does gunzip, zip and untar.
Input to the script is file name and file directory (where file is located)
I am reading the input parameters as follows:
FILENAME=$1
FILEDIR=$2
I have created 3 functions that are as follows:
1) gunzip file
2) unzip file
3) untar file
Say suppose the file name received is as follows:
I would to modify the file name to "mdm_ind_usa.2031.fsacm.tar.zip" after gunzip is done in gunzip function is called
Now file name should become
I would to modify the file name to "mdm_ind_usa.2031.fsacm.tar" after unzip is done in unzip function is called.
Now file name should become
and after untar function
Help is appreciated in order modify the filename as required.
Please Note: File Name passed to script could have any number of "." and "_". The file name i provided is for example purpose only.
Actually file name would vary.