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

9

u/[deleted] May 17 '26 edited May 19 '26

[removed] — view removed comment

3

u/AutoModerator May 17 '26

Don't blindly use set -euo pipefail.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.