SHTOOL-PLATFORM.TMP(1)
๐ SHTOOL-PLATFORM.TMP(1)
GNU Portable Shell Tool โ that's the manual name bestie, keep it in your notes ๐
okay so before we even get into it: this whole page is about asking your Unix box "who are you actually" and getting a real, structured answer back. it's giving detective energy ๐โจ
๐ธ NAME ๐ธ
shtool-platform โ GNU shtool's Unix platform identification. that's the name. short, sweet, iconic ๐
๐ฆ SYNOPSIS ๐ฆ
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]
ngl -n and -d are literally listed twice up there. not me editing that, that's just how the page is written ๐
๐ DESCRIPTION ๐
so shtool platform is a flexible Unix platform identification program. it figures out what platform you're on by looking at two things separately: your hardware architecture and your operating system. and for each of those two, there are three separate identifications: a class, a product and a technology. that's six identifications total, and every single one of them comes in a verbose, a regular and a concise flavour.
which means... math time bestie ๐งฎ โ that's eighteen (2x3x3) available identification strings per platform. and out of those eighteen, a given situation usually only wants about 2 of them. so how do you pick? you build the platform identification string yourself with a format string that contains one or more identification constructs, written like this:
"%[xx]"โ the verbose one"%{xx}"โ the regular one"%<xx>"โ the concise one
โจ OPTIONS โจ
here's everything you can pass it, no skips, no skimming, we're doing all of them ๐ซถ
-F,--formatformat โ controls the output formatting of the program. it's a plain-text string stuffed with"%"xxconstructs that expand into the various platform info strings."%{xx}"gives you the canonical regular version of the info,"%[xx]"gives you the verbose version, and"%<xx>"gives you the concise version. in total, these are all the constructs you can expand:%[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
and if you don't pass -F at all, the default format string is "%{sp} (%{ap})" โ which hands you the regular operating system product info plus the regular hardware architecture product info. cute and useful ๐
-S,--sepstring โ sets the word separation string used in the platform info strings. default is" "(whitespace). it's especially the thing separating the operating system name from the operating system version.-C,--concstring โ sets the word concatenation string used in the platform info strings. default is"/". it's especially used to glue multiple parts together inside operating system name and version parts.-L,--lowerโ forces the output to be all lowercase.-U,--upperโ forces the output to be all uppercase.-v,--verboseโ forces verbose versions of every expansion construct in the format string you gave to-F. it's exactly the same as writing all your expansion constructs as"%[xx]".-c,--conciseโ forces concise versions of every expansion construct in the format string you gave to-F. it's exactly the same as writing all your expansion constructs as"%<xx>".-n,--no-newlineโ drops the usual trailing newline character from the output.-t,--typetype โ the meta option ๐ it internally sets-F,-S,-C,-L,-U,-vor-cdepending on TYPE, so you can just name a commonly known output and vibe. these are the TYPEs:
binary
Binary Package Id (OpenPKG RPM). equal to -F '%<ap>-%<sp>' -L -S '' -C '+', and it gives you outputs like ix86-freebsd4.9 and ix86-debian3.0.
build
Build-Time Checking (OpenPKG RPM). equal to -F '%<at>-%<st>' -L -S '' -C '+', and it gives you outputs like i686-freebsd4.9 and i586-linux2.4.
gnu
GNU config.guess Style Id. similar to build, equal to -F '%<at>-unknown-%<st>' -L -S '' -C '+', and it gives you outputs like i686-unknown-freebsd4.9 and i586-unknown-linux2.4.
web
HTTP Server Header Id. equal to -F '%<sp>-%<ac>' -S '/' -C '+', and it gives you outputs like FreeBSD/4.9-iX86 and Debian/3.0-iX86.
summary
Human Readable Verbose Summary Information. equal to -F 'Class: %[sc] (%[ac])\nProduct: %[sp] (%[ap])\nTechnology: %[st] (%[at])' -S ' ' -C '/', and it gives you outputs like:
Class: 4.4BSD (iX86)
Product: FreeBSD 4.9-RC (iX86)
Technology: FreeBSD 4.9-RC (i686)
and also like:
Class: LSB (iX86)
Product: Debian GNU/Linux 3.0 (iX86)
Technology: GNU/Linux 2.2/2.4 (i686)
all-in-one
All-In-One Full-Table Information. this one literally just dumps out all 2x2x3 identification strings as a table. the whole thing. every crumb ๐
-d,--debugโ turns on some internal debugging messages.-V,--versionโ outputs the version information ofshtool platformand nothing else.-h,--helpโ outputs the usage information ofshtool platformand nothing else.
๐ EXAMPLE ๐
these are the real-life use cases that are known, bestie, straight from the field:
OpenPKG build-time decisions
$ platform -c -L -S "" -C "+" -F "%at-%st"
$ platform -c -L -S "" -C "+" -F "%ac-%sc"
OpenPKG binary RPM packages
$ platform -c -L -S "" -C "+" -F "%ap-%sp"
README files
$ platform -v -F "%sp (%ap)"
$ platform -v -F "%sc (%ac)"
Debugging
$ platform --type=all-in-one
๐ซถ SUPPORT ๐ซถ
shtool platform currently knows these 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.
every other Unix platform gets recognized through generic uname(1) information, so it usually can be identified sufficiently โ although ngl the identification might be not as precise as possible. so like, it works, it's just not doing the detailed thing ๐
๐ HISTORY ๐
shtool platform was implemented in September 2003 by Ralf S. Engelschall, for use in the OSSP and OpenPKG projects. it got prompted by OpenPKG needing both product identifiers (for RPM filenames) and technology identifiers (for build-time decisions) for the Unix platforms that OpenPKG packages are maintained for. and it was inspired by the GNU config.guess and the old GNU shtool guessos command. lore ๐
the major difference from GNU config.guess: shtool platform does not use a vendor identification โ because it cannot be determined most of the time and is not used at all in all the projects the author has ever seen โ and it's a lot more flexible, since it combines class, product and technology identifications with verbose, regular and concise outputs. the drawback? shtool platform (still) knows fewer particular platforms. though the generic platform identification is sufficient enough most of the time, fr fr.
๐ฅ SEE ALSO ๐ฅ
uname(3), GNU config.guess.
and that's the whole page bestie!! this version was shtool 2.0.8, dated 18-Jul-2008. go forth and identify platforms, you absolute main character ๐ โจ๐ฆ
๐ฆ where this page comes from
- debian bookworm: shtool 2.0.8-10 ยท GPL-2.0-or-later
- debian trixie: shtool 2.0.8-10 ยท GPL-2.0-or-later
- ubuntu jammy: shtool 2.0.8-10 ยท GPL-2.0-or-later
- ubuntu noble: shtool 2.0.8-10 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms