SHTOOL-PLATFORM.TMP(1) | GNU Portable Shell Tool | SHTOOL-PLATFORM.TMP(1) |
shtool-platform - GNU shtool Unix platform identification
shtool platform [-F|--format format] [-S|--sep string] [-C|--conc string] [-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise] [-n|--newline] [-d|--debug] [-t|--type type] [-n|--newline] [-d|--debug]
shtool platform is a flexible Unix platform identification program. It distinguishes a platform according to its hardware architecture and operating system. For both there is a class, product and technology identification. For each of those six identifications, there is a verbose, regular and concise version.
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 format string containing one or more identification constructs of the forms ""%[xx]"" (verbose), ""%{xx}"" (regular) and ""%<xx>"" (concise).
The following command line options are available.
%[ac] verbose hardware architecture class %{ac} regular hardware architecture class %<ac> concise hardware architecture class %[ap] verbose hardware architecture product %{ap} regular hardware architecture product %<ap> concise hardware architecture product %[at] verbose hardware architecture technology %{at} regular hardware architecture technology %<at> concise hardware architecture technology %[sc] verbose operating system class %{sc} regular operating system class %<sc> concise operating system class %[sp] verbose operating system product %{sp} regular operating system product %<sp> concise operating system product %[st] verbose operating system technology %{st} regular operating system technology %<st> concise operating system technology
The default format string is ""%{sp} (%{ap})"", providing the regular operating system and hardware architecture product information.
Class: 4.4BSD (iX86) Product: FreeBSD 4.9-RC (iX86) Technology: FreeBSD 4.9-RC (i686)
and
Class: LSB (iX86) Product: Debian GNU/Linux 3.0 (iX86) Technology: GNU/Linux 2.2/2.4 (i686)
The following real-life use cases are known:
$ platform -c -L -S "" -C "+" -F "%at-%st" $ platform -c -L -S "" -C "+" -F "%ac-%sc"
$ platform -c -L -S "" -C "+" -F "%ap-%sp"
$ platform -v -F "%sp (%ap)" $ platform -v -F "%sc (%ac)"
$ platform --type=all-in-one
shtool platform currently knows the following particular Unix platforms in detail: FreeBSD, NetBSD, OpenBSD, Linux, Sun Solaris, SCO UnixWare, QNX Neutrino, SGI IRIX, HP HP-UX, HP Tru64, IBM AIX and Apple Mac OS X Darwin.
All other Unix platforms are recognized through generic uname(1) information and so usually can be identified sufficiently, although the identification might be not as precise as possible.
shtool platform was implemented in September 2003 by Ralf S. Engelschall for use in the OSSP and OpenPKG projects. It was prompted by the need in OpenPKG to have both product (for RPM filenames) and technology (for build-time decisions) identifiers for the Unix platforms, OpenPKG packages are maintained for. It was inspired by the GNU config.guess and the old GNU shtool guessos command.
The major difference to GNU config.guess is that shtool platform does not use a vendor 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 shtool platform is that it (still) knows less particular platforms, although the generic platform identification is sufficient enough most of the time.
uname(3), GNU config.guess.
shtool 2.0.8 | 18-Jul-2008 |