annotate bin/cygclean @ 6:a6d23e7fab01
default tip
final, all sigs on multiple pages
| author |
Henry S. Thompson <ht@inf.ed.ac.uk> |
| date |
Thu, 08 Oct 2026 12:51:14 +0100 |
| parents |
bca2a490a6f4 |
| children |
|
| rev |
line source |
|
0
|
1 #!/bin/bash
|
|
|
2 cd ~/u/Downloads/Cygwin\ setup
|
|
|
3 pat=http*%3a%2f%2f*
|
|
|
4 me=$$
|
|
|
5 find $pat -type f -print0 | xargs -0 ls -t > ssn$me
|
|
|
6 find -L oldMirrors/$pat -type f -print0 | xargs -0 ls -t > sso$me
|
|
|
7 wc -l ss?$me
|
|
5
|
8 cat ss?$me | while read f; do sed 's/^.*[/]//;s/.tar.\(xz\|zst\|bz2\)$//'; done > ssb$me
|
|
|
9 while read f; do sed 's/[-._][-._0-9x]*$//'; done < ssb$me | sort | uniq -c | egrep -v ' 1 |setup.ini' | tr -s ' ' ' ' | cut -d ' ' -f 3 | sed 's/+/\\\\+/g' > ssp$me
|
|
|
10 while read p; do egrep -h "/$p[-._][0-9]" ss?$me|tail -n +2 ; done <ssp$me | xargs -n 100 rm
|
|
|
11 find $pat -type f | xargs ls -t > snn$me
|
|
|
12 find -L oldMirrors/$pat -type f | xargs ls -t > sno$me
|
|
0
|
13 wc -l sn?$me
|
|
5
|
14
|