Nontrivial shellscripts should be avoided.
Shellscripts should be avoided outside of constrained environments.
While commonly one would recommend Perl or Python, I'd say that some manner of standard-compliant Scheme or Common Lisp should be used if at all possible.
Perl is somewhat stable and readable, but Python is not stable and does a bad job of pretending it is (that script I wrote a decade ago should not have needed any modification to keep working).
