NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/52623: nonsense error message in awk

>Number:         52623
>Category:       bin
>Synopsis:       nonsense error message in awk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 16 02:05:00 +0000 2017
>Originator:     David A. Holland
>Release:        NetBSD 8.99.1 (20170809)
System: NetBSD macaran 8.99.1 NetBSD 8.99.1 (MACARAN) #42: Wed Aug 9 22:31:11 EDT 2017 dholland@macaran:/usr/src/sys/arch/amd64/compile/MACARAN amd64
Architecture: x86_64
Machine: amd64

Accidentally writing index[array] instead of array[index] in awk
causes a nonsense error message.


   awk -F: < /etc/passwd '{ a[$1] = $3; } END { for (k in a) print k[a]; }'
   awk: can't assign to k; it's an array name.
     input record number 123, file 
     source line number 1


Home | Main Index | Thread Index | Old Index