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