Skip to content

Conversation

@patsie75
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant