.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "SHTOOL-PLATFORM.TMP 1" .TH SHTOOL-PLATFORM.TMP 1 "shtool 2.0.8" "18-Jul-2008" "GNU Portable Shell Tool" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" shtool\-platform \- GNU shtool Unix platform identification .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBshtool platform\fR [\fB\-F\fR|\fB\-\-format\fR \fIformat\fR] [\fB\-S\fR|\fB\-\-sep\fR \fIstring\fR] [\fB\-C\fR|\fB\-\-conc\fR \fIstring\fR] [\fB\-L\fR|\fB\-\-lower\fR] [\fB\-U\fR|\fB\-\-upper\fR] [\fB\-v\fR|\fB\-\-verbose\fR] [\fB\-c\fR|\fB\-\-concise\fR] [\fB\-n\fR|\fB\-\-newline\fR] [\fB\-d\fR|\fB\-\-debug\fR] [\fB\-t\fR|\fB\-\-type\fR \fItype\fR] [\fB\-n\fR|\fB\-\-newline\fR] [\fB\-d\fR|\fB\-\-debug\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBshtool platform\fR is a flexible Unix platform identification program. It distinguishes a platform according to its \fIhardware architecture\fR and \fIoperating system\fR. For both there is a \fIclass\fR, \fIproduct\fR and \&\fItechnology\fR identification. For each of those six identifications, there is a \fIverbose\fR, \fIregular\fR and \fIconcise\fR version. .PP This leads to eighteen (2x3x3) available identification strings for each platform, from which usually 2 are chosen in a particular situation. This is done by assembling the platform identification string using a \&\fIformat\fR string containing one or more identification constructs of the forms "\f(CW\*(C`%[xx]\*(C'\fR\*(L" (verbose), \*(R"\f(CW\*(C`%{xx}\*(C'\fR\*(L" (regular) and \*(R"\f(CW\*(C`%\*(C'\fR" (concise). .SH "OPTIONS" .IX Header "OPTIONS" The following command line options are available. .IP "\fB\-F\fR, \fB\-\-format\fR \fIformat\fR" 4 .IX Item "-F, --format format" This option controls the output formatting of this program. It is a plain-text string with the "\f(CW\*(C`%\*(C'\fR\fIxx\fR\*(L" constructs which expand to the various platform information strings. \*(R"\f(CW\*(C`%{\*(C'\fR\fIxx\fR\f(CW\*(C`}\*(C'\fR\*(L" is the canonical regular version of the information. \*(R"\f(CW\*(C`%[\*(C'\fR\fIxx\fR\f(CW\*(C`]\*(C'\fR\*(L" is the verbose version of the information. \*(R"\f(CW\*(C`%<\*(C'\fR\fIxx\fR\f(CW\*(C`>\*(C'\fR" is the concise version of the information. In total, the following constructs are available for expansion: .Sp .Vb 3 \& %[ac] verbose hardware architecture class \& %{ac} regular hardware architecture class \& % concise hardware architecture class \& \& %[ap] verbose hardware architecture product \& %{ap} regular hardware architecture product \& % concise hardware architecture product \& \& %[at] verbose hardware architecture technology \& %{at} regular hardware architecture technology \& % concise hardware architecture technology \& \& %[sc] verbose operating system class \& %{sc} regular operating system class \& % concise operating system class \& \& %[sp] verbose operating system product \& %{sp} regular operating system product \& % concise operating system product \& \& %[st] verbose operating system technology \& %{st} regular operating system technology \& % concise operating system technology .Ve .Sp The default \fIformat\fR string is "\f(CW\*(C`%{sp} (%{ap})\*(C'\fR", providing the regular operating system and hardware architecture product information. .IP "\fB\-S\fR, \fB\-\-sep\fR \fIstring\fR" 4 .IX Item "-S, --sep string" This option sets the word \fIseparation\fR string for the platform information strings. By default it is "\f(CW\*(C` \*(C'\fR" (whitespace). It is especially used for separating the operating system name and the operating system version. .IP "\fB\-C\fR, \fB\-\-conc\fR \fIstring\fR" 4 .IX Item "-C, --conc string" This option sets the word \fIconcatenation\fR string for the platform information strings. By default it is "\f(CW\*(C`/\*(C'\fR". It is especially used to concatenate multiple parts in operating system name and version parts. .IP "\fB\-L\fR, \fB\-\-lower\fR" 4 .IX Item "-L, --lower" This options enforces conversion of the output to all \fIlower\fR case. .IP "\fB\-U\fR, \fB\-\-upper\fR" 4 .IX Item "-U, --upper" This options enforces conversion of the output to all \fIupper\fR case. .IP "\fB\-v\fR, \fB\-\-verbose\fR" 4 .IX Item "-v, --verbose" This option enforces verbose versions of all expansion constructs in \fIformat\fR string of option \fB\-F\fR. It is equal to specifying all expansion constructs as "\f(CW\*(C`%[\*(C'\fR\fIxx\fR\f(CW\*(C`]\*(C'\fR". .IP "\fB\-c\fR, \fB\-\-concise\fR" 4 .IX Item "-c, --concise" This option enforces concise versions of all expansion constructs in \fIformat\fR string of option \fB\-F\fR. It is equal to specifying all expansion constructs as "\f(CW\*(C`%<\*(C'\fR\fIxx\fR\f(CW\*(C`>\*(C'\fR". .IP "\fB\-n\fR, \fB\-\-no\-newline\fR" 4 .IX Item "-n, --no-newline" This option omits the usual trailing newline character in the output. .IP "\fB\-t\fR, \fB\-\-type\fR \fItype\fR" 4 .IX Item "-t, --type type" This option is a meta option which internally sets options \fB\-F\fR, \fB\-S\fR, \&\fB\-C\fR, \fB\-L\fR, \fB\-U\fR, \fB\-v\fR or \fB\-c\fR according to \fI\s-1TYPE\s0\fR. It can be used to easily specify various commonly known outputs. The following \fI\s-1TYPE\s0\fRs are available: .RS 4 .IP "\fBbinary\fR" 4 .IX Item "binary" Binary Package Id (OpenPKG \s-1RPM\s0). This is equal to "\f(CW\*(C`\-F \*(Aq%' \-L \-S '' \-C '+'>\*(L" and results in outputs like \*(R"\f(CW\*(C`ix86\-freebsd4.9\*(C'\fR\*(L" and \*(R"\f(CW\*(C`ix86\-debian3.0\*(C'\fR". .IP "\fBbuild\fR" 4 .IX Item "build" Build-Time Checking (OpenPKG \s-1RPM\s0). This is equal to "\f(CW\*(C`\-F \*(Aq%' \-L \-S '' \-C '+'>\*(L" and results in outputs like \*(R"\f(CW\*(C`i686\-freebsd4.9\*(C'\fR\*(L" and \*(R"\f(CW\*(C`i586\-linux2.4\*(C'\fR". .IP "\fBgnu\fR" 4 .IX Item "gnu" \&\s-1GNU\s0 \fIconfig.guess\fR Style Id. This is similar to \fBbuild\fR and is equal to "\f(CW\*(C`\-F \*(Aq"%' \-L \-S '' \-C '+'>\*(L" and results in outputs like \*(R"\f(CW\*(C`i686\-unknown\-freebsd4.9\*(C'\fR\*(L" and \*(R"\f(CW\*(C`i586\-unknown\-linux2.4\*(C'\fR". .IP "\fBweb\fR" 4 .IX Item "web" \&\s-1HTTP\s0 Server Header Id. This is equal to "\f(CW\*(C`\-F \*(Aq"%' \-S '/' \-C '+'>\*(L" and results in outputs like \*(R"\f(CW\*(C`FreeBSD/4.9\-iX86\*(C'\fR\*(L" and \*(R"\f(CW\*(C`Debian/3.0\-iX86\*(C'\fR". .IP "\fBsummary\fR" 4 .IX Item "summary" Human Readable Verbose Summary Information. This is equal to "\f(CW\*(C`\-F \&\*(AqClass: %[sc] (%[ac])\enProduct: %[sp] (%[ap])\enTechnology: %[st] (%[at])\*(Aq \-S \*(Aq \*(Aq \-C \*(Aq/\*(Aq\*(C'\fR" and results in outputs like: .Sp .Vb 3 \& Class: 4.4BSD (iX86) \& Product: FreeBSD 4.9\-RC (iX86) \& Technology: FreeBSD 4.9\-RC (i686) .Ve .Sp and .Sp .Vb 3 \& Class: LSB (iX86) \& Product: Debian GNU/Linux 3.0 (iX86) \& Technology: GNU/Linux 2.2/2.4 (i686) .Ve .IP "\fBall-in-one\fR" 4 .IX Item "all-in-one" All-In-One Full-Table Information. This just outputs really all 2x2x3 identification strings as a table. .RE .RS 4 .RE .IP "\fB\-d\fR, \fB\-\-debug\fR" 4 .IX Item "-d, --debug" This option enables some internal debugging messages. .IP "\fB\-V\fR, \fB\-\-version\fR" 4 .IX Item "-V, --version" This option outputs the version information of \fBshtool platform\fR only. .IP "\fB\-h\fR, \fB\-\-help\fR" 4 .IX Item "-h, --help" This option outputs the usage information of \fBshtool platform\fR only. .SH "EXAMPLE" .IX Header "EXAMPLE" The following real-life use cases are known: .IP "\fBOpenPKG\fR build-time decisions" 4 .IX Item "OpenPKG build-time decisions" .Vb 2 \& $ platform \-c \-L \-S "" \-C "+" \-F "%at\-%st" \& $ platform \-c \-L \-S "" \-C "+" \-F "%ac\-%sc" .Ve .IP "\fBOpenPKG\fR binary \s-1RPM\s0 packages" 4 .IX Item "OpenPKG binary RPM packages" .Vb 1 \& $ platform \-c \-L \-S "" \-C "+" \-F "%ap\-%sp" .Ve .IP "\fI\s-1README\s0\fR files" 4 .IX Item "README files" .Vb 2 \& $ platform \-v \-F "%sp (%ap)" \& $ platform \-v \-F "%sc (%ac)" .Ve .IP "Debugging" 4 .IX Item "Debugging" .Vb 1 \& $ platform \-\-type=all\-in\-one .Ve .SH "SUPPORT" .IX Header "SUPPORT" \&\fBshtool platform\fR currently knows the following particular Unix platforms in detail: FreeBSD, NetBSD, OpenBSD, Linux, Sun Solaris, \s-1SCO\s0 UnixWare, \&\s-1QNX\s0 Neutrino, \s-1SGI IRIX, HP\s0 HP-UX, \s-1HP\s0 Tru64, \s-1IBM AIX\s0 and Apple Mac \s-1OS X\s0 Darwin. .PP All other Unix platforms are recognized through generic \fBuname\fR\|(1) information and so usually can be identified sufficiently, although the identification might be not as precise as possible. .SH "HISTORY" .IX Header "HISTORY" \&\fBshtool platform\fR was implemented in September 2003 by \fIRalf S. Engelschall\fR for use in the \fB\s-1OSSP\s0\fR and \fBOpenPKG\fR projects. It was prompted by the need in \fBOpenPKG\fR to have both product (for \s-1RPM\s0 filenames) and technology (for build-time decisions) identifiers for the Unix platforms, OpenPKG packages are maintained for. It was inspired by the \fB\s-1GNU\s0\fR \fIconfig.guess\fR and the old \fB\s-1GNU\s0 shtool\fR \fIguessos\fR command. .PP The major difference to \fB\s-1GNU\s0\fR \fIconfig.guess\fR is that \fBshtool platform\fR does not use a \fIvendor\fR identification (cannot be determined most of the time and is not used at all in all projects I've ever seen) and is a lot more flexible (class, product and technology identifications combined with verbose, regular and concise outputs). The drawback of \&\fBshtool platform\fR is that it (still) knows less particular platforms, although the generic platform identification is sufficient enough most of the time. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBuname\fR\|(3), \s-1GNU\s0 \fIconfig.guess\fR.