#!/bin/sh # first find the files, calculate hash, sort by version then by hash+name excluding version find . -type f -print0 | xargs -0 -n200 shasum | sort -t '~' --key=2,2n | sort -s -t '~' --key=1,1 >/tmp/medleyfiles # now process the file list into the commands to fix up the links awk -f scripts/fixlinks.awk /tmp/medleyfiles >/tmp/doit