summaryrefslogtreecommitdiff
path: root/check.rc
blob: cdfdc64178f070f18f4d5e42195b376eebd709a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env rc

fn read {
	$HOME/9/plan9port-master/bin/read
}

fn sum {
	find $1 -type f | while (f = `{read}) {
		if (test -f $"f) {
			shasum -a 256 $"f
		}
	}
}

dir='b'
previous = ''
#cat sum | while (line = `{read}) {
sum $dir | sort | tee sum | while (line = `{read}) {
	sum = `{echo $line | sed -e 's/ .*//'}
	if (~ $sum $previous) {
		file = `{echo $line | sed -e 's/[^ ]*//'}
		echo $"file
	}
	
	previous = $sum
}