3 ms·
The biggest difference for general-purpose programming is that AWK supports floating-point arithmetic (and in some implementations arbitrary-precision arithmeti
by RodgerTheGreat 2y ago
The biggest difference for general-purpose programming is that AWK supports floating-point arithmetic (and in some implementations arbitrary-precision arithmetic), while bash does not. Shelling out to AWK is a much more portable approach to performing floating-point calculations in bash than "bc" or "dc", since it's available in more environments.
Older versions of bash also have extremely limited or nonexistent support for associative arrays, which can pose challenges compared to AWK. I think AWK has much nicer, less surprising syntax than bash, but that's just a subjective opinion.
- Brian_K_White 2y agoDefinitely to get power out of bash, you end up with write-only code with half the logic in all the exansions and word splitting hacks.