1 '\" te
   2 .\"  Copyright (c) 1992, X/Open Company Limited  All Rights Reserved  Portions Copyright (c) 1995, Sun Microsystems, Inc.  All Rights Reserved
   3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
   4 .\" http://www.opengroup.org/bookstore/.
   5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
   6 .\"  This notice shall appear on any product containing this material.
   7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
  10 .TH LOCALE 1 "Nov 28, 2017"
  11 .SH NAME
  12 locale \- get locale-specific information
  13 .SH SYNOPSIS
  14 .LP
  15 .nf
  16 \fBlocale\fR [\fB-a\fR | \fB-m\fR]
  17 .fi
  18 
  19 .LP
  20 .nf
  21 \fBlocale\fR [\fB-ck\fR] \fIname\fR...
  22 .fi
  23 
  24 .SH DESCRIPTION
  25 .LP
  26 The \fBlocale\fR utility writes information about the current locale
  27 environment, or all public locales, to the standard output. For the purposes of
  28 this section, a \fIpublic locale\fR is one provided by the implementation that
  29 is accessible to the application.
  30 .sp
  31 .LP
  32 When \fBlocale\fR is invoked without any arguments, it summarizes the current
  33 locale environment for each locale category as determined by the settings of
  34 the environment variables.
  35 .sp
  36 .LP
  37 When invoked with operands, it writes values that have been assigned to the
  38 keywords in the locale categories, as follows:
  39 .RS +4
  40 .TP
  41 .ie t \(bu
  42 .el o
  43 Specifying a keyword name selects the named keyword and the category containing
  44 that keyword.
  45 .RE
  46 .RS +4
  47 .TP
  48 .ie t \(bu
  49 .el o
  50 Specifying a category name selects the named category and all keywords in that
  51 category.
  52 .RE
  53 .SH OPTIONS
  54 .LP
  55 The following options are supported:
  56 .sp
  57 .ne 2
  58 .na
  59 \fB\fB-a\fR\fR
  60 .ad
  61 .RS 6n
  62 Writes information about all available public locales. The available locales
  63 include \fBPOSIX\fR, representing the POSIX locale.
  64 .RE
  65 
  66 .sp
  67 .ne 2
  68 .na
  69 \fB\fB-c\fR\fR
  70 .ad
  71 .RS 6n
  72 Writes the names of selected locale categories. The \fB-c\fR option increases
  73 readability when more than one category is selected (for example, via more than
  74 one keyword name or via a category name). It is valid both with and without the
  75 \fB-k\fR option.
  76 .RE
  77 
  78 .sp
  79 .ne 2
  80 .na
  81 \fB\fB-k\fR\fR
  82 .ad
  83 .RS 6n
  84 Writes the names and values of selected keywords. The implementation may omit
  85 values for some keywords; see OPERANDS.
  86 .RE
  87 
  88 .sp
  89 .ne 2
  90 .na
  91 \fB\fB-m\fR\fR
  92 .ad
  93 .RS 6n
  94 Writes names of available charmaps; see  \fBlocaledef\fR(1).
  95 .RE
  96 
  97 .SH OPERANDS
  98 .LP
  99 The following operand is supported:
 100 .sp
 101 .ne 2
 102 .na
 103 \fB\fIname\fR\fR
 104 .ad
 105 .RS 8n
 106 The name of a locale category, the name of a keyword in a locale category, or
 107 the reserved name \fBcharmap\fR. The named category or keyword will be selected
 108 for output. If a single \fIname\fR represents both a locale category name and a
 109 keyword name in the current locale, the results are unspecified; otherwise,
 110 both category and keyword names can be specified as \fIname\fR operands, in any
 111 sequence.
 112 .RE
 113 
 114 .SH EXAMPLES
 115 .LP
 116 \fBExample 1 \fRExamples of the locale utility
 117 .sp
 118 .LP
 119 In the following examples, the assumption is that locale environment variables
 120 are set as follows:
 121 
 122 .sp
 123 .in +2
 124 .nf
 125 LANG=locale_x LC_COLLATE=locale_y
 126 .fi
 127 .in -2
 128 .sp
 129 
 130 .sp
 131 .LP
 132 The command \fBlocale\fR would result in the following output:
 133 
 134 .sp
 135 .in +2
 136 .nf
 137 LANG=locale_x
 138 LC_CTYPE="locale_x"
 139 LC_NUMERIC="locale_x"
 140 LC_TIME="locale_x"
 141 LC_COLLATE=locale_y
 142 LC_MONETARY="locale_x"
 143 LC_MESSAGES="locale_x"
 144 LC_ALL=
 145 .fi
 146 .in -2
 147 .sp
 148 
 149 .sp
 150 .LP
 151 The command
 152 
 153 .sp
 154 .in +2
 155 .nf
 156 \fBLC_ALL=POSIX locale -ck decimal_point\fR
 157 .fi
 158 .in -2
 159 .sp
 160 
 161 .sp
 162 .LP
 163 would produce:
 164 
 165 .sp
 166 .in +2
 167 .nf
 168 LC_NUMERIC
 169 decimal_point="."
 170 .fi
 171 .in -2
 172 .sp
 173 
 174 .sp
 175 .LP
 176 The following command shows an application of \fBlocale\fR to determine whether
 177 a user-supplied response is affirmative:
 178 
 179 .sp
 180 .in +2
 181 .nf
 182 \fBif printf "%s\en" "$response" | /usr/bin/grep -Eq\e
 183         "$(locale yesexpr)"
 184 then
 185     affirmative processing goes here
 186 else
 187     non-affirmative processing goes here
 188 fi\fR
 189 .fi
 190 .in -2
 191 .sp
 192 
 193 .SH ENVIRONMENT VARIABLES
 194 .LP
 195 See \fBenviron\fR(5) for the descriptions of  \fBLANG\fR, \fBLC_ALL\fR,
 196 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
 197 .sp
 198 .LP
 199 The \fBLANG\fR, \fBLC_*\fR, and \fBNLSPATH\fR environment variables must
 200 specify the current locale environment to be written out. These environment
 201 variables will be used if the \fB-a\fR option is not specified.
 202 .SH EXIT STATUS
 203 .LP
 204 The following exit values are returned:
 205 .sp
 206 .ne 2
 207 .na
 208 \fB\fB0\fR\fR
 209 .ad
 210 .RS 6n
 211 All the requested information was found and output successfully.
 212 .RE
 213 
 214 .sp
 215 .ne 2
 216 .na
 217 \fB\fB>0\fR\fR
 218 .ad
 219 .RS 6n
 220 An error occurred.
 221 .RE
 222 
 223 .SH ATTRIBUTES
 224 .LP
 225 See \fBattributes\fR(5) for descriptions of the following attributes:
 226 .sp
 227 
 228 .sp
 229 .TS
 230 box;
 231 c | c
 232 l | l .
 233 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 234 _
 235 CSI     Enabled
 236 _
 237 Interface Stability     Standard
 238 .TE
 239 
 240 .SH SEE ALSO
 241 .LP
 242 \fBlocaledef\fR(1), \fBattributes\fR(5), \fBcharmap\fR(5), \fBenviron\fR(5),
 243 \fBlocale\fR(5), \fBstandards\fR(5)
 244 .SH NOTES
 245 .LP
 246 If \fBLC_CTYPE\fR or keywords in the category \fBLC_CTYPE\fR are specified,
 247 only the values in the range \fB0x00\fR-\fB0x7f\fR are written out.
 248 .sp
 249 .LP
 250 If \fBLC_COLLATE\fR or keywords in the category \fBLC_COLLATE\fR are specified,
 251 no actual values are written out.