Re: Check the linux type?
- From: "Lew Pitcher" <lpitcher@xxxxxxxxxxxx>
- Date: 29 Mar 2007 05:52:54 -0700
On Mar 29, 7:20 am, "SamG" <mad.vi...@xxxxxxxxx> wrote:
Hi,
How do i check what linux type am i using from a script. Like ubuntu
or suse or fedora.
There is no standard way to do that in a completely automated fashion.
/Some/ distributions record a file in /etc that contains their release
version number. This file is typically named with the name of the
distribution, and will either be called
/etc/*-version
or
/etc/*-release
but no distribution is required to provide such a file, and most
distributions work without it (meaning that it might have been deleted
by the time you go to look for it).
Perhaps the safest and most accurate way to determine the distribution
is to /ask/. Either have your script generate a message to the user
and wait for input (i.e. an interactive query) or require that the
user provide the distribution type as one of the arguments to the
script.
HTH
--
Lew
.
- References:
- Check the linux type?
- From: SamG
- Check the linux type?
- Prev by Date: Check the linux type?
- Next by Date: Re: Check the linux type?
- Previous by thread: Check the linux type?
- Next by thread: Re: Check the linux type?
- Index(es):
Relevant Pages
|