#!/bin/bash SORT=ftsort function do_sort() { printf "[$NUM/$TOTAL] Sorting $1\n" $SORT $1 } if [ ! -f "$1" ]; then echo "Usage: sort-all +" exit 1 fi TOTAL=`echo $* | wc -w` NUM=0 while [ "" != "$*" ]; do NUM=$((NUM + 1)) do_sort $1 shift done