Re: glean distro version from /etc/*release



On Fri, 8 Apr 2005, Stephen Day wrote:

> On Friday 08 April 2005 5:11 pm, Chris Devers wrote:
> >     [cdevers@debian ~]$ uname -a
> >     Linux debian 2.4.26-smp-p4 #1 SMP Thu Apr 29 17:20:05 EDT 2004 i686
> > unknown [cdevers@debian ~]$
>
> uname -a does not return the distribution. The second field is the
> hostname, which in your case seems to be 'debian'.

Right.

My line of thinking is that `uname -a` should be able to portably
identify the operating system, kernel version, and hardware
architecture, and anything beyond that you can infer by just trying
things and seeing what works.

In general, Perl scripts should be pretty portable across at least
POSIX-ish systems (any Linux version, OSX, Solaris, BSD, etc), and you
shouldn't need to know any more than what you'd get from $^O. If you
need some more detail, `uname -a` (among other ways) can give you most
of what you need.

There must be a module for this, but I can't think of the name...


--
Chris Devers