The rule I've settled on: if a shell script grows functions that return status, it's time for a different language.