| I advocate the following rules for when to write and when not to write a shell script. # Write a shell script: * Heavy lifting done by powerful tool (sort, grep, curl, git, sed, find, …) * Script will glue diverse tools * Workflow resembles a pipeline * Steps can be interactively developed as shell commands * Portability * Avoid dependency hell * One-off job # Avoid shell scripting: * Difficult to see the preceding patterns * Hot loops * Complex arithmetic / data structures / parameters / error handling * Mostly binary data * Large code body (> 500 LoC) * Need a user interface A need for associative arrays (implemented in Bash as via hashmaps) moves the task to the second category (avoid shell scripting). |
So this has inspired me to Ask HN, I’m getting ready to post it with a reference to this discussion, but thought I’d start here: does anyone know of a good resource for learning Python (or Go, Perl…any good small project/scripting/solo hacking languages) that’s tailored for folks who already have a good foundation in shell scripting, markup, config/infra automation, build tools, etc.? I’m open to books, web-based tutorials, apps, or just good examples for studying.
I’m open to the notion that I simply haven’t put in the work, and powered through the doldrums of novice tutorials far enough to get to where the meaty stuff is. Worst case, I’m a big fan of taking courses at the local community college for my own edification, absent any specific degree program or professional certification. It would still necessitate a lot of remedial/redundant steps, but I can always help others through those chapters while filling in any of my own gaps. Day-to-day, I generally work alone, but I find such things are easier with others to help motivate and focus my efforts. Perhaps I have answered my own question, but even still, I appreciate any advice/recommendations folks might have.