From 3ebe1038b3319e29f31ae0bd84fd73d924512a38 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Thu, 7 Mar 2019 15:27:04 +0100 Subject: Add tiny script running parallel instances of merge_entries --- parasort.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 parasort.sh diff --git a/parasort.sh b/parasort.sh new file mode 100644 index 0000000..6b54449 --- /dev/null +++ b/parasort.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +trap ctrl_c INT + +function ctrl_c() { + kill $(jobs -p) + echo "Killed." +} + +cd output || exit 1 +mkdir -p ../sorted + +for a in *[05]; do echo "$a" >&2; ../merge_entries $a > ../sorted/$a; done & +for a in *[16]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & +for a in *[27]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & +for a in *[38]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & +for a in *[49]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & +for a in brken *_; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & + +wait -- cgit v1.2.3