Mercurial > hg > batmud > misc
changeset 227:c88f0ebda59a misc
Improve findundone script.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 23 Dec 2011 02:26:51 +0200 |
parents | 92cbb05f66a6 |
children | c7e066bb1929 |
files | nun/tasks/findundone.sh |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/nun/tasks/findundone.sh Fri Dec 23 02:24:19 2011 +0200 +++ b/nun/tasks/findundone.sh Fri Dec 23 02:26:51 2011 +0200 @@ -1,7 +1,14 @@ #!/bin/sh +TASKDATA="taskdata.txt" +FINDREQS="findreqs.pl" if test "x$1" = "x"; then + echo "Find and compute list of undone nun tasks" echo "Usage: $0 <logfile>" + echo "" + echo "Logfile's last 500 lines MUST contain output of 'list' command" + echo "from the nun guild task room (at Sister Evelyn)." + echo "Also requires $TASKDATA and $FINDREQS script." exit 0 fi @@ -13,7 +20,7 @@ tail -500 "$LOGFILE" | perl -e 'my @tmp; while (<STDIN>) { if(/^ \| ([A-Z][^|]+)\| \[ \:. \]/) { $s = $1; $s =~ s/ *$//; push(@tmp,$s); }} print "$_\n" foreach (sort { $a cmp $b} @tmp); print STDERR "Found ".(scalar @tmp)." tasks.\n";' > "$TMPFILE" echo "Checking for missing (unopened) tasks ..." -perl -w findreqs.pl -tasks < taskdata.txt | while read i; do +perl -w "$FINDREQS" -tasks < "$TASKDATA" | while read i; do if ! grep "^$i" "$TMPFILE" > /dev/null; then echo "* $i" fi