1NL_LANGINFO(3am) GNU Awk Extension Modules NL_LANGINFO(3am)
2
3
4
6 nl_langinfo - retrieve locale-specific information strings
7
9 @load "nl_langinfo"
10
11 result = nl_langinfo(LANGINFO["variable"])
12
14 The nl_langinfo extension provides an AWK interface to the nl_lang‐
15 info(3) C library routine. It adds a single function named nl_lang‐
16 info(), and an array named LANGINFO.
17
18 The single argument in a call to nl_langinfo() should be one of the
19 available values in the LANGINFO array.
20
21 The return value is the requested string, or the empty string if an
22 error occurred.
23
24 The indices of LANGINFO are the names of various available strings as
25 given in the POSIX standard: see http://pubs.open‐
26 group.org/onlinepubs/9699919799/basedefs/langinfo.h.html. For example,
27 "D_T_FMT" is the current locale's date and time format for use with
28 strftime(3). See the standard for the full list.
29
31 @load "nl_langinfo"
32
33 # print the time and date in the locale's format
34 BEGIN {
35 print strftime(nl_langinfo(LANGINFO["D_T_FMT"]))
36 }
37
39 GAWK: Effective AWK Programming,
40
41 nl_langinfo(3).
42
44 Arnold Robbins, arnold@skeeve.com.
45
47 Copyright © 2012, 2013, Free Software Foundation, Inc.
48 Copyright © 2015, Arnold David Robbins.
49
50 Permission is granted to make and distribute verbatim copies of this
51 manual page provided the copyright notice and this permission notice
52 are preserved on all copies.
53
54 Permission is granted to copy and distribute modified versions of this
55 manual page under the conditions for verbatim copying, provided that
56 the entire resulting derived work is distributed under the terms of a
57 permission notice identical to this one.
58
59 Permission is granted to copy and distribute translations of this man‐
60 ual page into another language, under the above conditions for modified
61 versions, except that this permission notice may be stated in a trans‐
62 lation approved by the Foundation.
63
64
65
66 Jun 01 2015 NL_LANGINFO(3am)