diff options
Diffstat (limited to 'parasort.sh')
-rw-r--r-- | parasort.sh | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/parasort.sh b/parasort.sh index 6b54449..6565d61 100644 --- a/parasort.sh +++ b/parasort.sh | |||
@@ -7,14 +7,22 @@ function ctrl_c() { | |||
7 | echo "Killed." | 7 | echo "Killed." |
8 | } | 8 | } |
9 | 9 | ||
10 | cd output || exit 1 | 10 | if ! test -d work; then |
11 | mkdir -p ../sorted | 11 | printf "This directory contains no work/ directory.\n" |
12 | [ -d ../work ] && printf "(but .. does)\n" | ||
13 | exit 1 | ||
14 | fi | ||
12 | 15 | ||
13 | for a in *[05]; do echo "$a" >&2; ../merge_entries $a > ../sorted/$a; done & | 16 | export PATH=${PATH}:`pwd -P`/bin/ |
14 | for a in *[16]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & | 17 | |
15 | for a in *[27]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & | 18 | mkdir -p work/sorted |
16 | for a in *[38]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & | 19 | cd work/output || exit 1 |
17 | for a in *[49]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & | 20 | |
18 | for a in brken *_; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & | 21 | for a in *[05]; do echo "$a" >&2; merge_entries $a > ../sorted/$a; done & |
22 | for a in *[16]; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done & | ||
23 | for a in *[27]; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done & | ||
24 | for a in *[38]; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done & | ||
25 | for a in *[49]; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done & | ||
26 | for a in brken *_; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done & | ||
19 | 27 | ||
20 | wait | 28 | wait |