view bin/cygclean @ 1:95740c6658a3

from Meg
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Wed, 10 Jun 2026 13:04:44 +0100
parents 2aa53823fb21
children bca2a490a6f4
line wrap: on
line source

#!/bin/bash
cd ~/u/Downloads/Cygwin\ setup
pat=http*%3a%2f%2f*
me=$$
find $pat -type f -print0 | xargs -0 ls -t > ssn$me
find -L oldMirrors/$pat -type f -print0 | xargs -0 ls -t > sso$me
wc -l ss?$me
cat ss?$me | while read f; do echo `basename $f`; done > ssb$me
while read f; do echo ${f%%-[0-9]*}; done < ssb$me | sort | uniq -c | egrep -v ' 1 |setup.ini' | tr -s ' ' ' ' | cut -d ' ' -f 3 | sed 's/+/\\\\+/g' > ssp$me
while read p; do egrep -h "/$p-[0-9]" ss?$me|tail -n +2 ; done <ssp$me | xargs -n 100 rm
find $pat -type f -print0 | xargs -0 ls -t > snn$me
find -L oldMirrors/$pat -type f -print0 | xargs -0 ls -t > sno$me
wc -l sn?$me