root@clean2305:~# (echo a 1 ; echo b ) | awk '$2 != 0' a 1 b root@clean2305:~# (echo a ; echo b) | awk '$2 != 0' b root@clean2305:~# (echo a) | awk '$2 != 0' BusyBox v1.36.1 (2023-10-09 21:45:35 UTC) multi-call binary. Embedded in OpenWrt 23.05.0 Same problem also seen in 21.02 versions of OpenWrt I get the correct expected output from Ubuntu gawk and Debian mawk will@dev:~$ (echo a ; echo b) | awk '$3 != 0' a b
root@clean2305:~# (echo a; echo b) | awk 'BEGIN {ignore=$1} $2 != 0' b root@clean2305:~# (echo a; echo b) | awk 'BEGIN {ignore=$4} $2 != 0' a b root@clean2305:~# This is another example of the problem. Note that if we reference $4, then the initialisation is done right for the first line