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