Configure scripts

Rich Braun richb at pioneer.ci.net
Sun May 23 00:39:14 EDT 1999


> Jerry Feldman wrote:
> > I am looking for a distribution independent method to definitively determine
> > that I am running on a linux host. 
> > ...
> > uname returns Linux.
> > I test this on SuSE today, but I would surmise that uname is the best way
> > to go. Any thoughts.

David Kramer <david at kramer.ne.mediaone.net> wrote:
> Red Hat reports the same thing.  IMHO, I would use uname because it is
> the sole function of uname -s to tell you the name of the operating
> system.

The uname program runs on all Unix boxes.  Sometimes you want to get
more detailed info, though, so once you've established that you're on
Linux vs. Solaris you could examine more system info.

Linux and SysV-ish systems have a /proc filesystem; as an example,
/proc/cpuinfo reports the following on my box:

  processor       : 0
  cpu             : 586
  model           : Pentium 75+
  vendor_id       : GenuineIntel
  stepping        : 12
  fdiv_bug        : no
  hlt_bug         : no
  f00f_bug        : yes
  fpu             : yes
  fpu_exception   : yes
  cpuid           : yes
  wp              : yes
  flags           : fpu vme de pse tsc msr mce cx8
  bogomips        : 53.04

And the /proc/version file reports a username and the C compiler used to
build the kernel (these are in addition to what uname reports):

  Linux version 2.0.36 (richb at envoy.ci.net) (gcc version 2.7.2) #2 Wed Mar 10 09:15:25 EST 1999

In general, the /proc filesystem provides a whole lot of detail about the
system's hardware config--more so than any diags I've found on a Windows
box.

-rich
-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list