On 01-05-2021 05:36, David T-G wrote:
Lew, et al --
...and then Lew Wolfgang said... % % Hi Folks,
Good morning!
% ... % 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 [snip]
It depends on how much time you want to take. The ZIP file name appaers to be perfect* for each file, so you could either serialize it
for F in *-logfile.zip do unzip $F && mv logfile `basename $F .zip` || break done
or whip up a little script like
#!/bin/sh set -e [ -f $1 ] B=`basename $1 .zip` mkdir $B.dir cd $B.dir unzip ../$B mv logfile ../$B cd .. rmdir $B.dir
and parallelize
parallel /path/to/script ::: *-logfile.zip
it all. [If my parallel-fu were stronger, I'd whip out a
parallel blah blah blah ::: *-logfile.zip
one-liner that does it all, but ... not there yet :-]
* Well, unique, at least ... Why don't people use ISO format when they embed the date in a file name? Lord knows that sorting by day of the week isn't very useful ...
HTH & HANW
:-D
And for people with bad eye sight $(command) instead of `command` Jos vankan@linux-wo23:~> echo $(which echo) /usr/bin/echo vankan@linux-wo23:~> echo 'which echo' which echo vankan@linux-wo23:~> echo `which echo` /usr/bin/echo -- Jos van Kan registered Linux user #152704