NL_LANGINFO

NAME
SYNOPSIS
DESCRIPTION
EXAMPLE
SEE ALSO
AUTHOR
COPYING PERMISSIONS

NAME

nl_langinfo − gawk extension to retrieve locale-specific information strings

SYNOPSIS

@load "nl_langinfo"

result = nl_langinfo(LANGINFO["variable"])

DESCRIPTION

The nl_langinfo extension provides an AWK interface to the nl_langinfo(3) C library routine. It adds a single function named nl_langinfo(), and an array named LANGINFO.

The single argument in a call to nl_langinfo() should be one of the available values in the LANGINFO array.

The return value is the requested string, or the empty string if an error occurred.

The indices of LANGINFO are the names of various available strings as given in the POSIX standard: see http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html. For example, "D_T_FMT" is the current locale’s date and time format for use with strftime(3). See the standard for the full list.

EXAMPLE

@load "nl_langinfo"

# print the time and date in the locale’s format
BEGIN {
print strftime(nl_langinfo(LANGINFO["D_T_FMT"]))
}

SEE ALSO

GAWK: Effective AWK Programming,

nl_langinfo(3).

AUTHOR

Arnold Robbins, arnold@skeeve.com.

COPYING PERMISSIONS

Copyright © 2012, 2013, Free Software Foundation, Inc.
Copyright © 2015, Arnold David Robbins.

Permission is granted to make and distribute verbatim copies of this manual page provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this manual page under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual page into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Foundation.