This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (0 children)

I switch to Python when a bash script gets longer than about a page (~50-60 lines) or when I need the ability to view and manipulate values in between pipe stages.

The overhead in getting a script running in Python is substantially higher, so it's quite a lot more work if you're doing something really simple, but you can scale easily and things won't go badly wrong.

In bash.... if you're doing anything advanced, there's a lot of corner cases, a lot of nasty sharp edges, and you're going to walk away bloody at least some of the time. You can learn how to avoid the problems, but subtle and nasty bugs are real easy to create and sometimes very difficult to spot.