bpftools
bpftools copied to clipboard
Fix awk assignment instead of comparisson
if (n=0) is always 'falsey' since assignment results to the value being assigned (in case of 0 that would be 0, which in awk is considered 'falsey')
~/git/cloudflare/bpftools$ awk 'BEGIN { if (n=0) print (n=0) }'
~/git/cloudflare/bpftools$ awk 'BEGIN { if (n=1) print (n=1) }'
1
~/git/cloudflare/bpftools$ awk 'BEGIN { if (n=2) print (n=2) }'
2