locale(1) locale(1)
NAME
locale - get locale-specific information
SYNOPSIS
locale [ -a| -m]
locale [-ck] name...
DESCRIPTION
The locale utility writes information about the current locale
environment to the standard output. When locale is invoked without any
arguments, it summarises the current locale environment for each locale
category as determined by the settings of the environment variables
defined LANG, LCALL, LCCTYPE, LCCOLLATE, LCMONETARY, LCNUMERIC,
LCTIME, and LCMESSAGES.
When invoked with operands, it writes values that have been assigned to
the keywords in the locale categories, as follows:
-Specifying a keyword name selects the named keyword and the category
containing that keyword.
-Specifying a category name selects the named category and all keywords
in that category.
The following options are supported:
-a Write information about all available locales.
-c Write the names of selected locale categories; see STDOUT. The -c
option increases readability when more than one category is selected
(for example, via more than one keyword name or via a category
name). It is valid both with and without the -k option.
-k Write the names and values of selected keywords.
-m Write names of available charmaps.
name The name of a locale category, the name of a keyword in a locale
category, or the reserved name charmap. The specified category or
keyword is selected for output.
EXAMPLES
In the following examples, the assumption is that locale environment
variables are set as follows:
> LANG =en_US LCCOLLATE =fr
> locale
would result in the following output:
LANG=en_US
LC_COLLATE="fr"
Page 1
locale(1) locale(1)
LC_CTYPE="en_US"
LC_TIME="en_US"
LC_NUMERIC="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_ALL=
> LCALL =en_US locale -ck decimalpoint
would produce:
LC_NUMERIC
decimal_point="."
The following command shows an application of locale to determine whether
a user-supplied response is affirmative:
if printf "%s0 "$response" | grep -Eq "$( local yesstr )"
then
affirmative processing goes here
else
non-affirmative processing goes here
fi
FILES
/usr/lib/locale/
system supported locales
Page 2