FWIW the shell is out of the question; we tried writing this in shell and making it do what we need was deemed too brittle/hard/impossible. The question is not whether shell is ok; the question is what to use instead.
2 Likes