#!/bin/sh set -e if [ ! -x ./main ]; then make main fi if [ "$1" = "" ]; then echo "Usage: $0 " exit 1 fi if [ ! -d "$1" ]; then echo "$0: $1 is not a directory" exit 1 fi find $1 -type f | while read i; do OUTPUT="$(echo "$i" | tr -d / | sed 's/^[.]*//').txt" echo "$0: outputting to $OUTPUT" if [ -f "$OUTPUT" ]; then echo "$0: file already exists, skipping" continue fi touch "$OUTPUT" ./main -4 $i | tee -a "$OUTPUT" | while read line; do echo -n . done echo "done." done