[email protected] (Eric Schnoebelen) writes:

> Jean-Louis Martineau writes:

> - selfcheck try to return the distro and version of the OS.
> - How can it get that information on freebsd? or other bsd?
> - How to get the 'FreeBSD' string and the '10.1' string?
>
>       uname -s -> 'FreeBSD'/'NetBSD'/'OpenBSD'/'DragonFlyBSD'
>       uname -r -> '10.1'/'6.1_STABLE'/...
>
> "uname -s" provides the system name, and "uname -r" provides the
> OS revision (on every UNIX family system except Linux, where
> they return "Linux" and the kernel revision.  A side effect of
> how Linux distributions are created.)

Note that uname is specified by POSIX:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/uname.html

So really, uname output should be used first, and if there needs to be
some Linux-specific extra information because of "distributions", that
should be special-case code for Linux.

FWIW, uname -s and -r on a NetBSD box:

NetBSD
6.1_STABLE

Attachment: pgp3rWNMgGuT4.pgp
Description: PGP signature

Reply via email to