1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#!/bin/bash SORT=ftsort function do_sort() { printf "[$NUM/$TOTAL] Sorting $1\n" $SORT $1 } if [ ! -f "$1" ]; then echo "Usage: sort-all <file.ft>+" exit 1 fi TOTAL=`echo $* | wc -w` NUM=0 while [ "" != "$*" ]; do NUM=$((NUM + 1)) do_sort $1 shift done