1SHTOOL-PLATFORM.TMP(1) GNU Portable Shell Tool SHTOOL-PLATFORM.TMP(1)
2
3
4
6 shtool platform - GNU shtool Unix platform identification
7
9 shtool platform [-F|--format format] [-S|--sep string] [-C|--conc
10 string] [-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise]
11 [-n|--newline] [-d|--debug] [-t|--type type] [-n|--newline]
12 [-d|--debug]
13
15 shtool platform is a flexible Unix platform identification program. It
16 distinguishes a platform according to its hardware architecture and
17 operating system. For both there is a class, product and technology
18 identification. For each of those six identifications, there is a
19 verbose, regular and concise version.
20
21 This leads to eighteen (2x3x3) available identification strings for
22 each platform, from which usually 2 are chosen in a particular
23 situation. This is done by assembling the platform identification
24 string using a format string containing one or more identification
25 constructs of the forms ""%[xx]"" (verbose), ""%{xx}"" (regular) and
26 ""%<xx>"" (concise).
27
29 The following command line options are available.
30
31 -F, --format format
32 This option controls the output formatting of this program. It is a
33 plain-text string with the ""%"xx" constructs which expand to the
34 various platform information strings. ""%{"xx"}"" is the canonical
35 regular version of the information. ""%["xx"]"" is the verbose
36 version of the information. ""%<"xx">"" is the concise version of
37 the information. In total, the following constructs are available
38 for expansion:
39
40 %[ac] verbose hardware architecture class
41 %{ac} regular hardware architecture class
42 %<ac> concise hardware architecture class
43
44 %[ap] verbose hardware architecture product
45 %{ap} regular hardware architecture product
46 %<ap> concise hardware architecture product
47
48 %[at] verbose hardware architecture technology
49 %{at} regular hardware architecture technology
50 %<at> concise hardware architecture technology
51
52 %[sc] verbose operating system class
53 %{sc} regular operating system class
54 %<sc> concise operating system class
55
56 %[sp] verbose operating system product
57 %{sp} regular operating system product
58 %<sp> concise operating system product
59
60 %[st] verbose operating system technology
61 %{st} regular operating system technology
62 %<st> concise operating system technology
63
64 The default format string is ""%{sp} (%{ap})"", providing the
65 regular operating system and hardware architecture product
66 information.
67
68 -S, --sep string
69 This option sets the word separation string for the platform
70 information strings. By default it is "" "" (whitespace). It is
71 especially used for separating the operating system name and the
72 operating system version.
73
74 -C, --conc string
75 This option sets the word concatenation string for the platform
76 information strings. By default it is ""/"". It is especially used
77 to concatenate multiple parts in operating system name and version
78 parts.
79
80 -L, --lower
81 This options enforces conversion of the output to all lower case.
82
83 -U, --upper
84 This options enforces conversion of the output to all upper case.
85
86 -v, --verbose
87 This option enforces verbose versions of all expansion constructs
88 in format string of option -F. It is equal to specifying all
89 expansion constructs as ""%["xx"]"".
90
91 -c, --concise
92 This option enforces concise versions of all expansion constructs
93 in format string of option -F. It is equal to specifying all
94 expansion constructs as ""%<"xx">"".
95
96 -n, --no-newline
97 This option omits the usual trailing newline character in the
98 output.
99
100 -t, --type type
101 This option is a meta option which internally sets options -F, -S,
102 -C, -L, -U, -v or -c according to TYPE. It can be used to easily
103 specify various commonly known outputs. The following TYPEs are
104 available:
105
106 binary
107 Binary Package Id (OpenPKG RPM). This is equal to ""-F
108 '%<ap"-%<sp>' -L -S '' -C '+'>" and results in outputs like
109 ""ix86-freebsd4.9"" and ""ix86-debian3.0"".
110
111 build
112 Build-Time Checking (OpenPKG RPM). This is equal to ""-F
113 '%<at"-%<st>' -L -S '' -C '+'>" and results in outputs like
114 ""i686-freebsd4.9"" and ""i586-linux2.4"".
115
116 gnu GNU config.guess Style Id. This is similar to build and is
117 equal to ""-F '"%<at"-unknown-%<st>' -L -S '' -C '+'>" and
118 results in outputs like ""i686-unknown-freebsd4.9"" and
119 ""i586-unknown-linux2.4"".
120
121 web HTTP Server Header Id. This is equal to ""-F '"%<sp"-%<ac>' -S
122 '/' -C '+'>" and results in outputs like ""FreeBSD/4.9-iX86""
123 and ""Debian/3.0-iX86"".
124
125 summary
126 Human Readable Verbose Summary Information. This is equal to
127 ""-F 'Class: %[sc] (%[ac])\nProduct: %[sp] (%[ap])\nTechnology:
128 %[st] (%[at])' -S ' ' -C '/'"" and results in outputs like:
129
130 Class: 4.4BSD (iX86)
131 Product: FreeBSD 4.9-RC (iX86)
132 Technology: FreeBSD 4.9-RC (i686)
133
134 and
135
136 Class: LSB (iX86)
137 Product: Debian GNU/Linux 3.0 (iX86)
138 Technology: GNU/Linux 2.2/2.4 (i686)
139
140 all-in-one
141 All-In-One Full-Table Information. This just outputs really all
142 2x2x3 identification strings as a table.
143
144 -d, --debug
145 This option enables some internal debugging messages.
146
147 -V, --version
148 This option outputs the version information of shtool platform
149 only.
150
151 -h, --help
152 This option outputs the usage information of shtool platform only.
153
155 The following real-life use cases are known:
156
157 OpenPKG build-time decisions
158 $ platform -c -L -S "" -C "+" -F "%at-%st"
159 $ platform -c -L -S "" -C "+" -F "%ac-%sc"
160
161 OpenPKG binary RPM packages
162 $ platform -c -L -S "" -C "+" -F "%ap-%sp"
163
164 README files
165 $ platform -v -F "%sp (%ap)"
166 $ platform -v -F "%sc (%ac)"
167
168 Debugging
169 $ platform --type=all-in-one
170
172 shtool platform currently knows the following particular Unix platforms
173 in detail: FreeBSD, NetBSD, OpenBSD, Linux, Sun Solaris, SCO UnixWare,
174 QNX Neutrino, SGI IRIX, HP HP-UX, HP Tru64, IBM AIX and Apple Mac OS X
175 Darwin.
176
177 All other Unix platforms are recognized through generic uname(1)
178 information and so usually can be identified sufficiently, although the
179 identification might be not as precise as possible.
180
182 shtool platform was implemented in September 2003 by Ralf S.
183 Engelschall for use in the OSSP and OpenPKG projects. It was prompted
184 by the need in OpenPKG to have both product (for RPM filenames) and
185 technology (for build-time decisions) identifiers for the Unix
186 platforms, OpenPKG packages are maintained for. It was inspired by the
187 GNU config.guess and the old GNU shtool guessos command.
188
189 The major difference to GNU config.guess is that shtool platform does
190 not use a vendor identification (cannot be determined most of the time
191 and is not used at all in all projects I've ever seen) and is a lot
192 more flexible (class, product and technology identifications combined
193 with verbose, regular and concise outputs). The drawback of shtool
194 platform is that it (still) knows less particular platforms, although
195 the generic platform identification is sufficient enough most of the
196 time.
197
199 uname(3), GNU config.guess.
200
201
202
20318-Jul-2008 shtool 2.0.8 SHTOOL-PLATFORM.TMP(1)