As mentioned above, things that belong in shell, and NOT in Python:
- file system paths (these are parameters to Python scripts, not hard coded)
- port numbers
- user names
- other config values
- concurrency -- you can get really far with xargs -P, and sometimes &
- pipelines (try doing this in Python without shelling out; it's horrible)
Things that belong in Python and NOT shell: - complex control flow (e.g. I rarely write loops in bash; never a nested loop)
- data structures (bash has hash tables, but I never use them)
- arithmetic
- parsing and cleaning individual lines or fields of data
Basically it's policy vs mechanism. They really are mutually exclusive, and work well together.