summaryrefslogtreecommitdiffstats
path: root/sort-all
blob: 7a0b63b574507ad2e506d3dd0297b1ff5b5e1a9a (plain) (blame)
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