The following runs successfully with gawk: BEGIN { print "Enter some stuff, stop with . (dot):\n" while(getline) if($1 == "." && NF == 1) break; else list[i++] = $0 for(j=0; j<i; j++) print list[j] } It fails in busybox with: $ /sbin/busybox awk -f testcase.awk awk: testcase.awk:3: Unexpected token If I adjust the script to the following, it will run properly: BEGIN { print "Enter some stuff, stop with . (dot):\n" while(getline) if($1 == "." && NF == 1) { break } else list[i++] = $0 for(j=0; j<i; j++) print list[j] } I have found this behavior on Oracle Linux 5.10 Busybox version 1.2.0, and Mingw-Win32 Busybox version v1.23.0-TIG-1525-ge19594c
Fixed in git: http://git.busybox.net/busybox/commit/?id=5f8daefb835687e428215f90d26fdf1f0206149d