Where the line is.
WHAT SHELL SCRIPTS DO WELL
Running commands in sequence File operations Short automation Anything fundamentally about invoking other programs
WHAT THEY DO BADLY
Complex conditions Data structures String processing beyond the simple Error handling Testing Anything maintained over years
WHAT THE SIGNS ARE THAT YOU HAVE OUTGROWN IT
Functions being defined Arrays and associative arrays appearing Substantial conditional logic Difficulty understanding your own script Length beyond a screen or two
WHAT TO MOVE TO
A general-purpose scripting language.
WHY
Better error handling, testability, data structures, and libraries.
WHAT TO KEEP IN SHELL
Thin wrappers invoking things.
WHAT TO NOT DO
Rewrite working scripts without reason.
WHAT TO DO INSTEAD
Rewrite when it next needs substantial change.
WHAT TO ALWAYS ADD REGARDLESS OF LANGUAGE
Logging Failure handling Safety to run twice A way to test without causing damage