diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-17 23:27:14 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-17 23:27:14 -0500 |
commit | 465c42dd51644745a1238d2603b718c07aa251b2 (patch) | |
tree | 65adb0323094def711a41f58aee0aaa625dd3c93 | |
parent | 4017bdc2b370c13763fbb40b80bbe775f6617ece (diff) |
add helper to reoder feather-trace events in many log files
-rwxr-xr-x | sort-all | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sort-all b/sort-all new file mode 100755 index 0000000..7a0b63b --- /dev/null +++ b/sort-all | |||
@@ -0,0 +1,23 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | SORT=ftsort | ||
4 | |||
5 | function do_sort() { | ||
6 | printf "[$NUM/$TOTAL] Sorting $1\n" | ||
7 | $SORT $1 | ||
8 | } | ||
9 | |||
10 | if [ ! -f "$1" ]; then | ||
11 | echo "Usage: sort-all <file.ft>+" | ||
12 | exit 1 | ||
13 | fi | ||
14 | |||
15 | TOTAL=`echo $* | wc -w` | ||
16 | |||
17 | NUM=0 | ||
18 | |||
19 | while [ "" != "$*" ]; do | ||
20 | NUM=$((NUM + 1)) | ||
21 | do_sort $1 | ||
22 | shift | ||
23 | done | ||