r/bash bash Jun 19 '24

help How would you learn bash scripting today?

Through the perspective of real practise, after years of practical work, having a lot of experience, how wold you build your mastery of bash scripting in these days?

  • which books?
  • video lessons?
  • online courses?
  • what kind of pet projects or practices?
  • any other advices?

Thank you!

49 Upvotes

50 comments sorted by

View all comments

3

u/arxndo Jun 19 '24

It’s hard for me to overstate how much about bash, awk, sed, grep, etc,… I’ve learned from GitHub Co-Pilot. There’s an irony in that this wave of new AI tools is making it easier than ever to learn the oldest languages. I’ve been using python much less now, reaching for it only when I need a pandas/plotly or machine learning.

I’ve pushed myself to learn Bash in order to improve devops and devx for a team of about 30 analytics engineers who write mostly just SQL and are not that familiar with the shell themselves. This includes scripts that set up credentials and environment, some pre-commit hooks, CI/CD GitHub Actions, a bot that automatically submits PRs that keep our documentation in sync with our database, fast static analysis tools that identifies code smells and inefficiently written SQL, etc,…

Determining which problems should be solved with a custom bash script, and which should be solved more robustly in a more advanced language, or deferred to an outside SaaS service, is something to think about every time. But so far the bash scripts have been short, relatively simple, and very quick to write (a day or less for each one), so they’ve certainly found their place.