Mercurial > hg > aboriginal
changeset 312:dd28934bb0c9
Add --stat option, plus better help text when run with no arguments.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 30 Mar 2008 17:53:00 -0500 |
parents | a791ca629d9c |
children | cc673b708b3b |
files | forkbomb.sh |
diffstat | 1 files changed, 17 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/forkbomb.sh Sat Mar 29 19:06:29 2008 -0500 +++ b/forkbomb.sh Sun Mar 30 17:53:00 2008 -0500 @@ -12,7 +12,7 @@ nice -n 20 ./package-mini-native.sh $1 } -if [ "$1" != "--watch" ] +if [ "$1" != "--watch" ] && [ "$1" != "--stat" ] then if [ $# -ne 0 ] then @@ -33,12 +33,27 @@ then (buildarch $i > out-$i.txt 2>&1 &)& else - echo "Usage: forkbomb.sh [--fork] [--nofork] [--watch]" + echo "Usage: forkbomb.sh [--fork] [--nofork] [--watch] [--stat]" + echo -e "\t--nofork Build all targets one after another." + echo -e "\t--fork Build all targets in parallel (needs lots of RAM)." + echo -e "\t--watch Restart monitor for --nofork." + echo -e "\t--stat Grep logfiles for success/failure after build." exit 1 fi done fi +if [ "$1" == "--stat" ] +then + echo "Success:" + grep -l qemu-image- out-*.txt + + echo "Failed:" + (ls -1 out-*.txt; grep -l qemu-image- out-*.txt) | sort | uniq -u + + exit 0 +fi + if [ "$1" != "--nofork" ] then watch -n 3 'X=; for i in out-*.txt; do /bin/echo -e "$X$i"; X="\n"; tail -n 1 $i; done'