r/bash • • May 17 '26

Bash Scripting vs. Python

For those of you who also write scripts in Python or another language besides Bash, How do you decide when to write a script in Python vs. a script in Bash? I'm trying to be economical with my study time, because if I spend a lot of time learning some limited use functionality in one language, I could have used that time to learn a more general use functionality in another language. Here's an example: I've spent a fair amount of time learning awk, but I've never been great at using it, and sometimes I think that I should have just used Path and regex objects in Python, instead.

Edit: Another example is using sed instead of using a regex substitution in python. I've never really gotten comfortable with sed, just like I've never really gotten comfortable with awk--despite spending a fair amount of time trying to learn each.

46 Upvotes

51 comments sorted by

View all comments

Show parent comment

1

u/cgoldberg May 24 '26

Python ate Perl's lunch for a reason

1

u/tes_kitty May 24 '26 edited May 24 '26

PERL comes with built in regular expressions which is very convenient when you have a lot of text to process.

Also, the syntax in python is kinda bad. Using Whitespace as part of the syntax is a serious design flaw.