On 01/05/2021 04.09, Lew Wolfgang wrote:
Hi Folks,
I've got a little problem here that I bet someone here could handle.
I've got a couple of thousand zip files that some knuckle-headed package created that have to be unpacked for inspection. They're named with a long date-time group with the .zip extension, as in
Fri-Apr-30-185859-PDT-2021-logfile.zip
Alas, they all unpack to the same filename: logfile
So what's the easiest way to unzip them all and add the date-time string to the resultant logfile name so that they all don't unpack to the same filename and step on each other. Awk maybe? A clever pipeline with xargs? Or?
I would unpack one by one, with a script, and rename "logfile" to "ISODATE-logfile" somehow, no compression, to a different directory. Then, on that directory you could instead do "gzip *", not zip. Advantage? there are tools like zgrep designed to work on compressed logs. If that looks interesting, we can concoct a script. The only part I can not think yet about (early tea phase) is how to convert to isodate. I agree with David, and I would say that's the only date format that makes any sense. All others should be shot and burnt :-P for FILE in ls *zip do unzip $FILE etc... -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)