SHTL-PLATFORM.TMP(1) GNU Portable Shell Tool SHTL-PLATFORM.TMP(1) NNAAMMEE sshhttooooll ppllaattffoorrmm - GGNNUU sshhttooooll Unix platform identification SSYYNNOOPPSSIISS sshhttooooll ppllaattffoorrmm [--FF|----ffoorrmmaatt _f_o_r_m_a_t] [--SS|----sseepp _s_t_r_i_n_g] [--CC|----ccoonncc _s_t_r_i_n_g] [--LL|----lloowweerr] [--UU|----uuppppeerr] [--vv|----vveerrbboossee] [--cc|----ccoonncciissee] [--nn|----nneewwlliinnee] [--dd|----ddeebbuugg] [--tt|----ttyyppee _t_y_p_e] [--nn|----nneewwlliinnee] [--dd|----ddeebbuugg] DDEESSCCRRIIPPTTIIOONN sshhttooooll ppllaattffoorrmm is a flexible Unix platform identification program. It distinguishes a platform according to its _h_a_r_d_w_a_r_e _a_r_c_h_i_t_e_c_t_u_r_e and _o_p_e_r_a_t_i_n_g _s_y_s_t_e_m. For both there is a _c_l_a_s_s, _p_r_o_d_u_c_t and _t_e_c_h_n_o_l_o_g_y identification. For each of those six identifications, there is a _v_e_r_b_o_s_e, _r_e_g_u_l_a_r and _c_o_n_c_i_s_e 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 _f_o_r_m_a_t string containing one or more identification constructs of the forms ""%[xx]"" (verbose), ""%{xx}"" (regular) and ""%"" (concise). OOPPTTIIOONNSS The following command line options are available. --FF, ----ffoorrmmaatt _f_o_r_m_a_t This option controls the output formatting of this program. It is a plain-text string with the ""%"_x_x" constructs which expand to the various platform information strings. ""%{"_x_x"}"" is the canonical regular version of the information. ""%["_x_x"]"" is the verbose version of the information. ""%<"_x_x">"" is the concise version of the information. In total, the following constructs are available for expansion: %[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 18-Jul-2008 shtool 2.0.8 1 SHTL-PLATFORM.TMP(1) GNU Portable Shell Tool SHTL-PLATFORM.TMP(1) %[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 The default _f_o_r_m_a_t string is ""%{sp} (%{ap})"", providing the regular operating system and hardware architecture product information. --SS, ----sseepp _s_t_r_i_n_g This option sets the word _s_e_p_a_r_a_t_i_o_n string for the platform information strings. By default it is "" "" (whitespace). It is especially used for separating the operating system name and the operating system version. --CC, ----ccoonncc _s_t_r_i_n_g This option sets the word _c_o_n_c_a_t_e_n_a_t_i_o_n string for the platform information strings. By default it is ""/"". It is especially used to concatenate multiple parts in operating system name and version parts. --LL, ----lloowweerr This options enforces conversion of the output to all _l_o_w_e_r case. --UU, ----uuppppeerr This options enforces conversion of the output to all _u_p_p_e_r case. --vv, ----vveerrbboossee This option enforces verbose versions of all expansion constructs in _f_o_r_m_a_t string of option --FF. It is equal to specifying all expansion constructs as ""%["_x_x"]"". --cc, ----ccoonncciissee This option enforces concise versions of all expansion constructs in _f_o_r_m_a_t string of option --FF. It is equal to specifying all expansion constructs as ""%<"_x_x">"". --nn, ----nnoo--nneewwlliinnee This option omits the usual trailing newline character in the output. --tt, ----ttyyppee _t_y_p_e This option is a meta option which internally sets options --FF, --SS, --CC, --LL, --UU, --vv or --cc according to _T_Y_P_E. It can be used to easily specify various commonly known outputs. The following _T_Y_P_Es are available: 18-Jul-2008 shtool 2.0.8 2 SHTL-PLATFORM.TMP(1) GNU Portable Shell Tool SHTL-PLATFORM.TMP(1) bbiinnaarryy Binary Package Id (OpenPKG RPM). This is equal to ""-F '%' -L -S '' -C '+'>" and results in outputs like ""ix86-freebsd4.9"" and ""ix86-debian3.0"". bbuuiilldd Build-Time Checking (OpenPKG RPM). This is equal to ""-F '%' -L -S '' -C '+'>" and results in outputs like ""i686-freebsd4.9"" and ""i586-linux2.4"". ggnnuu GNU _c_o_n_f_i_g_._g_u_e_s_s Style Id. This is similar to bbuuiilldd and is equal to ""-F '"%' -L -S '' -C '+'>" and results in outputs like ""i686-unknown-freebsd4.9"" and ""i586-unknown-linux2.4"". wweebb HTTP Server Header Id. This is equal to ""-F '"%' -S '/' -C '+'>" and results in outputs like ""FreeBSD/4.9-iX86"" and ""Debian/3.0-iX86"". ssuummmmaarryy Human Readable Verbose Summary Information. This is equal to ""-F 'Class: %[sc] (%[ac])\nProduct: %[sp] (%[ap])\nTechnology: %[st] (%[at])' -S ' ' -C '/'"" and results in outputs like: 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) aallll--iinn--oonnee All-In-One Full-Table Information. This just outputs really all 2x2x3 identification strings as a table. --dd, ----ddeebbuugg This option enables some internal debugging messages. --VV, ----vveerrssiioonn This option outputs the version information of sshhttooooll ppllaattffoorrmm only. --hh, ----hheellpp This option outputs the usage information of sshhttooooll ppllaattffoorrmm only. 18-Jul-2008 shtool 2.0.8 3 SHTL-PLATFORM.TMP(1) GNU Portable Shell Tool SHTL-PLATFORM.TMP(1) EEXXAAMMPPLLEE The following real-life use cases are known: OOppeennPPKKGG build-time decisions $ platform -c -L -S "" -C "+" -F "%at-%st" $ platform -c -L -S "" -C "+" -F "%ac-%sc" OOppeennPPKKGG binary RPM packages $ platform -c -L -S "" -C "+" -F "%ap-%sp" _R_E_A_D_M_E files $ platform -v -F "%sp (%ap)" $ platform -v -F "%sc (%ac)" Debugging $ platform --type=all-in-one SSUUPPPPOORRTT sshhttooooll ppllaattffoorrmm 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 _u_n_a_m_e(1) information and so usually can be identified sufficiently, although the identification might be not as precise as possible. HHIISSTTOORRYY sshhttooooll ppllaattffoorrmm was implemented in September 2003 by _R_a_l_f _S_. _E_n_g_e_l_s_c_h_a_l_l for use in the OOSSSSPP and OOppeennPPKKGG projects. It was prompted by the need in OOppeennPPKKGG 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 GGNNUU _c_o_n_f_i_g_._g_u_e_s_s and the old GGNNUU sshhttooooll _g_u_e_s_s_o_s command. The major difference to GGNNUU _c_o_n_f_i_g_._g_u_e_s_s is that sshhttooooll ppllaattffoorrmm does not use a _v_e_n_d_o_r 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 sshhttooooll ppllaattffoorrmm is that it (still) knows less particular platforms, although the generic platform identification is sufficient enough most of the time. SSEEEE AALLSSOO _u_n_a_m_e(3), GNU _c_o_n_f_i_g_._g_u_e_s_s. 18-Jul-2008 shtool 2.0.8 4