Re:Shell Script Best Practices, from a decade of scripting t...
by 2devnull on Thursday October 27, 2022 @11:51AM
(#33359431)
I feel like I do this every three years then proceed to never use it. Then I read a post on hn and think about how great it could be; rinse and repeat
Re:Shell Script Best Practices, from a decade of scripting t...
by boredtofears on Thursday October 27, 2022 @12:03PM
(#33359596)
yeah thats exactly right. it may only take an hour to learn, but every time i need to use awk it seems like i have to spend an hour to re-learn its goofy syntax.
Re:Shell Script Best Practices, from a decade of scripting t...
by tejtm on Thursday October 27, 2022 @02:36PM
(#33361978)
alas this is true,
I never correctly recall the order of particular function args as they are
fairly random, still beats the alternative of having to continually internalize entire fragile ecosystems to achieve the same goal.
Re:Shell Script Best Practices, from a decade of scripting t...
by boredtofears on Thursday October 27, 2022 @03:24PM
(#33362705)
yeah you're definitely right. im sure if it was something i had to use more consistently i'd be able to commit it to memory. maybe...
Re:Shell Script Best Practices, from a decade of scripting t...
by chasil on Thursday October 27, 2022 @03:50PM
(#33363073)
Brian Kernighan covers the entire [new] awk language in 40 pages - chapter 2.
There are people who have asked me scripting questions for over a decade, who will not read this for some reason.
It could be read in an hour, but not fully retained.
For those that haven't taken the time yet, I think this is a good place to start:
https://learnxinyminutes.com/docs/awk/
Of course, some people do very advanced things in awk and I absolutely agree that 1 hour of study isn't going to make you a ninja, but it's absolutely enough to learn the awk programming paradigm so that when the need arises you can quickly mobilize the solution you need.
For example: If you're quick to the draw, it can take less time to write an awk one liner to calculate the average of a column in a csv than it does to copy the csv into excel and highlight the column. It's a massive productivity booster.