Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: the splits



On Wed, May 22, 2024, at 3:25 PM, Ray Andrews wrote:
> Gotta learn awk!  Nuts, made the wrong choice going with sed.

No.  Although awk is more powerful than sed, they each have their
own strengths and suitable use cases [1].  It'd be pretty goofy to
do this:

	awk '/foo/ { gsub(/bar/, "baz") }; 1'

instead of this:

	sed /foo/s/bar/baz/g

You're hamstringing yourself with this "learn one tool" mindset.
Familiarity with a variety of tools helps you approach problems
from different perspectives and avoid the law of the instrument
[2][3].

[1]: https://mywiki.wooledge.org/BashProgramming/02#Strength_reduction
[2]: https://en.wikipedia.org/wiki/Law_of_the_instrument
[3]: https://eev.ee/blog/2011/04/17/architectural-fallacies/#maslows-hammer

-- 
vq




Messages sorted by: Reverse Date, Date, Thread, Author