]>
git.saurik.com Git - apple/ld64.git/blob - unit-tests/bin/rm-stale-test-logs
4 echo Usage
: $0 number
-of-tests-logs-to-keep
5 echo where number
-of-tests-logs-to-keep must be a non
-zero integer
9 # Usage: if no arguments
12 # Check if requesting 0 tests to remain!
15 # don't test directly--use the result value
16 # because the command can fail for badly formed integers
19 # get the dir names of all tests in date order
20 ls -1dtr /tmp
/proctor
*>/tmp
/all$$
2>/dev
/null
22 # select the last few to keep
23 tail -$1 /tmp
/all$$
>/tmp
/keep$$
25 # get a list of the others
26 DELLIST
=`diff /tmp/all$$ /tmp/keep$$|grep '^<'|sed -e 's/^< //'`
36 rm /tmp
/all$$
/tmp
/keep$$