1WHAT(1P) POSIX Programmer's Manual WHAT(1P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 what - identify SCCS files (DEVELOPMENT)
13
15 what [-s] file...
16
18 The what utility shall search the given files for all occurrences of
19 the pattern that get (see get ) substitutes for the %Z% keyword (
20 "@(#)" ) and shall write to standard output what follows until the
21 first occurrence of one of the following:
22
23
24 " > newline \ NUL
25
27 The what utility shall conform to the Base Definitions volume of
28 IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines.
29
30 The following option shall be supported:
31
32 -s Quit after finding the first occurrence of the pattern in each
33 file.
34
35
37 The following operands shall be supported:
38
39 file A pathname of a file to search.
40
41
43 Not used.
44
46 The input files shall be of any file type.
47
49 The following environment variables shall affect the execution of what:
50
51 LANG Provide a default value for the internationalization variables
52 that are unset or null. (See the Base Definitions volume of
53 IEEE Std 1003.1-2001, Section 8.2, Internationalization Vari‐
54 ables for the precedence of internationalization variables used
55 to determine the values of locale categories.)
56
57 LC_ALL If set to a non-empty string value, override the values of all
58 the other internationalization variables.
59
60 LC_CTYPE
61 Determine the locale for the interpretation of sequences of
62 bytes of text data as characters (for example, single-byte as
63 opposed to multi-byte characters in arguments and input files).
64
65 LC_MESSAGES
66 Determine the locale that should be used to affect the format
67 and contents of diagnostic messages written to standard error.
68
69 NLSPATH
70 Determine the location of message catalogs for the processing of
71 LC_MESSAGES .
72
73
75 Default.
76
78 The standard output shall consist of the following for each file oper‐
79 and:
80
81
82 "%s:\n\t%s\n", <pathname>, <identification string>
83
85 The standard error shall be used only for diagnostic messages.
86
88 None.
89
91 None.
92
94 The following exit values shall be returned:
95
96 0 Any matches were found.
97
98 1 Otherwise.
99
100
102 Default.
103
104 The following sections are informative.
105
107 The what utility is intended to be used in conjunction with the SCCS
108 command get, which automatically inserts identifying information, but
109 it can also be used where the information is inserted by any other
110 means.
111
112 When the string "@(#)" is included in a library routine in a shared
113 library, it might not be found in an a.out file using that library rou‐
114 tine.
115
117 If the C-language program in file f.c contains:
118
119
120 char ident[] = "@(#)identification information";
121
122 and f.c is compiled to yield f.o and a.out, then the command:
123
124
125 what f.c f.o a.out
126
127 writes:
128
129
130 f.c:
131 identification information
132 ...
133 f.o:
134 identification information
135 ...
136 a.out:
137 identification information
138 ...
139
141 None.
142
144 None.
145
147 get
148
150 Portions of this text are reprinted and reproduced in electronic form
151 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
152 -- Portable Operating System Interface (POSIX), The Open Group Base
153 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
154 Electrical and Electronics Engineers, Inc and The Open Group. In the
155 event of any discrepancy between this version and the original IEEE and
156 The Open Group Standard, the original IEEE and The Open Group Standard
157 is the referee document. The original Standard can be obtained online
158 at http://www.opengroup.org/unix/online.html .
159
160
161
162IEEE/The Open Group 2003 WHAT(1P)