NetBSD-Bugs archive

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

bin/42320: LC_NUMERIC in awk is not POSIX compliant



>Number:         42320
>Category:       bin
>Synopsis:       LC_NUMERIC in awk is not POSIX  compliant
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 15 11:20:00 +0000 2009
>Originator:     Alexander Nasonov
>Release:        NetBSD 5.99.22
>Organization:
>Environment:
$ uname -a
NetBSD aa1nb.lan 5.99.22 NetBSD 5.99.22 (MONOLITHIC) #0: Sat Nov 14 16:49:42 
GMT 2009  
root%aa1nb.lan@localhost:/home/alnsn/src/netbsd-current/src/sys/arch/i386/compile/obj/MONOLITHIC
 i386

>Description:
awk doesn't recognise the period character if ${LC_NUMERIC} is a locale with 
comma decimal-point character. There is a special case in POSIX specs for this 
situation:

http://www.opengroup.org/onlinepubs/7990989775/xcu/awk.html

LC_NUMERIC
    Determine the radix character used when interpreting numeric input, 
performing conversions between numeric and string values and formatting numeric 
output. Regardless of locale, the period character (the decimal-point character 
of the POSIX locale) is the decimal-point character recognised in processing 
awk programs (including assignments in command-line arguments). 
>How-To-Repeat:
$ LC_NUMERIC=ru_RU.KOI8-R /usr/bin/awk '{print 0.01}'
/usr/bin/awk: syntax error at source line 1
 context is
        {print >>>  0.01 <<< 
/usr/bin/awk: illegal statement at source line 1

>Fix:



Home | Main Index | Thread Index | Old Index