You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

36 lines
563 B

  1. #!/bin/sh
  2. set -e
  3. if [ ! -x ./main ]; then
  4. make main
  5. fi
  6. if [ "$1" = "" ]; then
  7. echo "Usage: $0 <directory>"
  8. exit 1
  9. fi
  10. if [ ! -d "$1" ]; then
  11. echo "$0: $1 is not a directory"
  12. exit 1
  13. fi
  14. OUTPUT="$(echo "$1" | tr -d /).txt"
  15. echo "$0: outputting to $OUTPUT"
  16. touch "$OUTPUT"
  17. find $1 -type f | while read i; do
  18. J="$(basename "$i")"
  19. if grep -q "$J" "$OUTPUT"; then
  20. continue
  21. fi
  22. if TMP="$(./main -5 "$i")"; then
  23. echo "$TMP" >> "$OUTPUT"
  24. echo "$TMP"
  25. else
  26. echo "@@@ FAILURE on $i @@@"
  27. fi
  28. done