summaryrefslogtreecommitdiff
path: root/parasort.sh
diff options
context:
space:
mode:
Diffstat (limited to 'parasort.sh')
-rw-r--r--parasort.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/parasort.sh b/parasort.sh
new file mode 100644
index 0000000..6b54449
--- /dev/null
+++ b/parasort.sh
@@ -0,0 +1,20 @@
1#!/bin/sh
2
3trap ctrl_c INT
4
5function ctrl_c() {
6 kill $(jobs -p)
7 echo "Killed."
8}
9
10cd output || exit 1
11mkdir -p ../sorted
12
13for a in *[05]; do echo "$a" >&2; ../merge_entries $a > ../sorted/$a; done &
14for a in *[16]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done &
15for a in *[27]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done &
16for a in *[38]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done &
17for a in *[49]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done &
18for a in brken *_; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done &
19
20wait