3 ms·
Oh you hit the nail on the head! I have written some really basic shell scripts, and I try to use common shell modules/commands whenever it makes sense. It's j
by krono 5y ago
Oh you hit the nail on the head!
I have written some really basic shell scripts, and I try to use common shell modules/commands whenever it makes sense. It's just so confusing sometimes.
The main challenges I faced in the beginning where caused by MacOS. MacOS comes with an older version of Bash, its default shell ZSH comes with its own slight variations on how it expects you to do things, and the utilities that come with MacOS aren't Gnu so the available options/arguments are not what you would find online.
Then there is so much conflicting information online! A lot of it is also ancient, as in newsgroup archives from the 90s.
String manipulation. When I look up how to do some specific replacement again, I come across all these massive inline awk scripts. But then I remember I could also just use sed and regex, or in some cases even just standard variable tricks, and achieve the desired result with 90% fewer code.
The bigger scripts I've written are a mess.. I think. I still haven't been able to figure out how to error exit out of the entire script from a function that was called within it... :)