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 "Dec 20, 1996"
  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 .sp
  26 .LP
  27 The \fBlocale\fR utility writes information about the current locale
  28 environment, or all public locales, to the standard output. For the purposes of
  29 this section, a \fIpublic locale\fR is one provided by the implementation that
  30 is accessible to the application.
  31 .sp
  32 .LP
  33 When \fBlocale\fR is invoked without any arguments, it summarizes the current
  34 locale environment for each locale category as determined by the settings of
  35 the environment variables.
  36 .sp
  37 .LP
  38 When invoked with operands, it writes values that have been assigned to the
  39 keywords in the locale categories, as follows:
  40 .RS +4
  41 .TP
  42 .ie t \(bu
  43 .el o
  44 Specifying a keyword name selects the named keyword and the category containing
  45 that keyword.
  46 .RE
  47 .RS +4
  48 .TP
  49 .ie t \(bu
  50 .el o
  51 Specifying a category name selects the named category and all keywords in that
  52 category.
  53 .RE
  54 .SH OPTIONS
  55 .sp
  56 .LP
  57 The following options are supported:
  58 .sp
  59 .ne 2
  60 .na
  61 \fB\fB-a\fR\fR
  62 .ad
  63 .RS 6n
  64 Writes information about all available public locales. The available locales
  65 include \fBPOSIX\fR, representing the POSIX locale.
  66 .RE
  67 
  68 .sp
  69 .ne 2
  70 .na
  71 \fB\fB-c\fR\fR
  72 .ad
  73 .RS 6n
  74 Writes the names of selected locale categories. The \fB-c\fR option increases
  75 readability when more than one category is selected (for example, via more than
  76 one keyword name or via a category name). It is valid both with and without the
  77 \fB-k\fR option.
  78 .RE
  79 
  80 .sp
  81 .ne 2
  82 .na
  83 \fB\fB-k\fR\fR
  84 .ad
  85 .RS 6n
  86 Writes the names and values of selected keywords. The implementation may omit
  87 values for some keywords; see OPERANDS.
  88 .RE
  89 
  90 .sp
  91 .ne 2
  92 .na
  93 \fB\fB-m\fR\fR
  94 .ad
  95 .RS 6n
  96 Writes names of available charmaps; see  \fBlocaledef\fR(1).
  97 .RE
  98 
  99 .SH OPERANDS
 100 .sp
 101 .LP
 102 The following operand is supported:
 103 .sp
 104 .ne 2
 105 .na
 106 \fB\fIname\fR\fR
 107 .ad
 108 .RS 8n
 109 The name of a locale category, the name of a keyword in a locale category, or
 110 the reserved name \fBcharmap\fR. The named category or keyword will be selected
 111 for output. If a single \fIname\fR represents both a locale category name and a
 112 keyword name in the current locale, the results are unspecified; otherwise,
 113 both category and keyword names can be specified as \fIname\fR operands, in any
 114 sequence.
 115 .RE
 116 
 117 .SH EXAMPLES
 118 .LP
 119 \fBExample 1 \fRExamples of the locale utility
 120 .sp
 121 .LP
 122 In the following examples, the assumption is that locale environment variables
 123 are set as follows:
 124 
 125 .sp
 126 .in +2
 127 .nf
 128 LANG=locale_x LC_COLLATE=locale_y
 129 .fi
 130 .in -2
 131 .sp
 132 
 133 .sp
 134 .LP
 135 The command \fBlocale\fR would result in the following output:
 136 
 137 .sp
 138 .in +2
 139 .nf
 140 LANG=locale_x
 141 LC_CTYPE="locale_x"
 142 LC_NUMERIC="locale_x"
 143 LC_TIME="locale_x"
 144 LC_COLLATE=locale_y
 145 LC_MONETARY="locale_x"
 146 LC_MESSAGES="locale_x"
 147 LC_ALL=
 148 .fi
 149 .in -2
 150 .sp
 151 
 152 .sp
 153 .LP
 154 The command
 155 
 156 .sp
 157 .in +2
 158 .nf
 159 \fBLC_ALL=POSIX locale -ck decimal_point\fR
 160 .fi
 161 .in -2
 162 .sp
 163 
 164 .sp
 165 .LP
 166 would produce:
 167 
 168 .sp
 169 .in +2
 170 .nf
 171 LC_NUMERIC
 172 decimal_point="."
 173 .fi
 174 .in -2
 175 .sp
 176 
 177 .sp
 178 .LP
 179 The following command shows an application of \fBlocale\fR to determine whether
 180 a user-supplied response is affirmative:
 181 
 182 .sp
 183 .in +2
 184 .nf
 185 \fBif printf "%s\en" "$response" | /usr/xpg4/bin/grep -Eq\e
 186         "$(locale yesexpr)"
 187 then
 188     affirmative processing goes here
 189 else
 190     non-affirmative processing goes here
 191 fi\fR
 192 .fi
 193 .in -2
 194 .sp
 195 
 196 .SH ENVIRONMENT VARIABLES
 197 .sp
 198 .LP
 199 See \fBenviron\fR(5) for the descriptions of  \fBLANG\fR, \fBLC_ALL\fR,
 200 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
 201 .sp
 202 .LP
 203 The \fBLANG\fR, \fBLC_*\fR, and \fBNLSPATH\fR environment variables must
 204 specify the current locale environment to be written out. These environment
 205 variables will be used if the \fB-a\fR option is not specified.
 206 .SH EXIT STATUS
 207 .sp
 208 .LP
 209 The following exit values are returned:
 210 .sp
 211 .ne 2
 212 .na
 213 \fB\fB0\fR\fR
 214 .ad
 215 .RS 6n
 216 All the requested information was found and output successfully.
 217 .RE
 218 
 219 .sp
 220 .ne 2
 221 .na
 222 \fB\fB>0\fR\fR
 223 .ad
 224 .RS 6n
 225 An error occurred.
 226 .RE
 227 
 228 .SH ATTRIBUTES
 229 .sp
 230 .LP
 231 See \fBattributes\fR(5) for descriptions of the following attributes:
 232 .sp
 233 
 234 .sp
 235 .TS
 236 box;
 237 c | c
 238 l | l .
 239 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 240 _
 241 CSI     Enabled
 242 _
 243 Interface Stability     Standard
 244 .TE
 245 
 246 .SH SEE ALSO
 247 .sp
 248 .LP
 249 \fBlocaledef\fR(1), \fBattributes\fR(5), \fBcharmap\fR(5), \fBenviron\fR(5),
 250 \fBlocale\fR(5), \fBstandards\fR(5)
 251 .SH NOTES
 252 .sp
 253 .LP
 254 If \fBLC_CTYPE\fR or keywords in the category \fBLC_CTYPE\fR are specified,
 255 only the values in the range \fB0x00\fR-\fB0x7f\fR are written out.
 256 .sp
 257 .LP
 258 If \fBLC_COLLATE\fR or keywords in the category \fBLC_COLLATE\fR are specified,
 259 no actual values are written out.