#!/usr/bin/gawk -F ' ' -f BEGIN { split(urls, url_array, " "); for(i in url_array){ split(url_array[i], url_components, ":"); url_type[i] = url_components[1]; } IFS=" "; } # { print $0 } /^# \S+ HASH$/ { hash=tolower(gensub(/^# (\S+) HASH$/, "\\1", "", $0)) # print "hash='" hash "'" } /^[a-fA-F0-9]+ \S+/ { files[$2] = 1; # print "file: " $2 verification[$2] = verification[$2] "" $1 "" } END { print ""; print ""; print ""; for(file in files){ print ""; print " "; print " " verification[file]; print " "; print " "; for (i in url_array) { url = url_array[i]; type = url_type[i]; print " " url "/" file "" } print " "; print ""; } print ""; print ""; }