In a directory below tar files are there, the value between first and second delimiter(-) indicates
store name
i,e "ban", "can", "tan" etc are store names
PTP03-ban-end03.tar
PTP21-can-end03.tar
PTP21-moc-end03.tar
PTP21-moc-end03.tar
PTP21-can-end03.tar
PTP21-can-end03.tar
i want to retain only one tar file per store in my current directory and move the remaining tar files to Temp directory
so in this case for stores "moc", "can" we have more than one tar file
so for stores "moc", "can" the tar file which got created first should be retained in current dicrectory and remaining
files should be moved to temp directory