The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
0answers
60 views

Is there a reference for the assembler-like output produced by `awk -W dump`?

The command awk -W dump ... produces a dump of "assembler-like" code (as shown here [link], or by reading the man). Some of the instructions are easy to guess at their meaning such as jz, which is ...
10
votes
5answers
531 views

How to print own script name in mawk?

In bash $0 contains the name of the script, but in awk if I make a script named myscript.awk with the following content: #!/usr/bin/awk -f BEGIN{ print ARGV[0] } and run it, it will only print ...
3
votes
1answer
2k views

Walking Multidimensional arrays in Mawk

I'm able to do this properly in gawk, but when I tried to post my code to the machine where it will run, I realized it was using mawk... $ cat multidim.gawk # test of multidimensional arrays // { ...
2
votes
1answer
160 views

Regular Expressions within a string in AWK using if/then control structure?

PROBLEM I want to specifically use AWK (GAWK, MAWK, whatever) in an AWK script to sum up the values in field 9 for every record that contains "runner__.jpx" (the underscores are placeholders for two ...
0
votes
3answers
451 views

Is it mandatory to have a variable in awk's first statement?

I am having some hard time with awk today. If I try to do: df|awk '{print $2; $some=$2; print $some}' It works as expected and I get the size of the disks twice but if I do: df|awk '{$some=$2; ...