3 ms·
> Is there something in the awk script that makes it advantageous over a shell script? Pseudo multi-dimensional associative arrays for representing the depende
by tyingq 3y ago
> Is there something in the awk script that makes it advantageous over a shell script?
Pseudo multi-dimensional associative arrays for representing the dependency graph of make. This part:
for (i = 2; i <= NF; i++)
slist[nm, ++scnt[nm]] = $i
The way awk supports them is hacky and not really a multidimensional array, but still is better than what you would have to do with bash, because of split() and some other language features.
It would be much easier with any scripting language though, Perl for example.