"What are strengths of shell scripting that make it an indispensable tool as compared to Python?"
The shell is not indispensable. Why do you think there are so many? bash, tcsh, csh, sh, etc., etc.,
Python is a shell. Not the one you'd use for running all commands, but for scripting, it's ideal.
Python is a more-or-less standard part of all Linux distro's.
The more traditional shells do too many things.
They have a handy user interface for running commands. This includes one-line commands where the shell searches your PATH, forks and execs the requested program. It also includes pipelines, sequences and concurrent programs (using ;
, |
and &
) as well as some redirection (using >
and <
).
They have a crummy little programming-language-like capability for running scripts. This language is rather hard to use and extremely inefficient. Most statements in this language require forking one or more additional processes, wasting time and memory.
Running programs from the shell, redirecting stderr to a log file and that kind of thing is good. Do that in the shell.
Almost everything else can be done more efficiently and more clearly as a Python script.
You need both. However, you should never write a script with if-statements or loops in a traditional shell language.