Hi,

On 18 Nov., 16:07, "Brian McKee" <[EMAIL PROTECTED]> wrote:
> OTOH, if anyone has some suggestions on cleaning up this mongrel code
> that swaps BSD style md5 to GNU md5sum style checksums I'd appreciate
> it.  (I am not a programmer, as you can probably tell)  It works, but
> it looks horrible.
>
>> cat *.md5 | sed 's/[()]//g' | awk '{ print $4," ",$2 } ' | sed 's/  \+\</  
>> /g' > $CHECKSUMFILE ;
>> md5sum -cv $CHECKSUMFILE ;

What about

awk 'BEGIN {FS="[\ \t=\(\)]+"} /^MD5 \(.*\) = [0-9a-z]+$/ {print $3"
"$2}' *.md5 |md5sum -cv;

or

awk 'BEGIN {FS="[\ \t=\(\)]+"} /^MD5 \(.*\) = [0-9a-z]+$/ {print $3"
"$2}' *.md5 >$CHECKSUMFILE;
md5sum -cv $CHECKSUMFILE

if you prefer the intermediate file ...???

Or shorter (without line syntax check):

awk 'BEGIN {FS="[\ \t=\(\)]+"} {print $3"  "$2}' *.md5 |md5sum -cv
--
Regards,
 Pit
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to