[Bug 13361] New: awk NF corrupt when using FS regex and + (matching one or more of preceding expression)

bugzilla at busybox.net bugzilla at busybox.net
Fri Dec 4 15:12:18 UTC 2020


https://bugs.busybox.net/show_bug.cgi?id=13361

            Bug ID: 13361
           Summary: awk NF corrupt when using FS regex and + (matching one
                    or more of preceding expression)
           Product: Busybox
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: mavik at live.com.au
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

I think that in all the following cases the value of `$NF` should be the empty
string as is output by gawk (see below).

{{{
# printf "a==123=" | awk -F '=+' '{print $NF}'
=
# printf "a===123=" | awk -F '=+' '{print $NF}'
3=
# printf "a====123=" | awk -F '=+' '{print $NF}'
23=
# printf "a=====123=" | awk -F '=+' '{print $NF}'
123=
}}}

This is the output from gawk:

{{{
$ printf "a==123=" | awk -F '=+' '{print $NF}'

$ printf "a===123=" | awk -F '=+' '{print $NF}'

$ printf "a====123=" | awk -F '=+' '{print $NF}'

$ printf "a=====123=" | awk -F '=+' '{print $NF}'

}}}

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list