1 2 3 4 5 6 7 8 9 10
BEGIN { n=0 } /^#/ {next} { if (cmd[$2] == "") { print "#define " $2 " " n; cmd[$2] = n; } n++; }