Re: Check the linux type?



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



.



Relevant Pages

  • Re: Distributing applications that use 3rd party modules
    ... I'm getting into Python now after years of Perl, ... Imagine that you've written a script that uses several libraries, ... Create a distribution setup script in the same directory. ...
    (comp.lang.python)
  • Re: Vulnerability and Patch-Management in Linux (and other Unix)
    ... RedHat offers "RedHat Network", but it costs a lot of money (and they ... OS distribution because of application software support requirements ... the above script runs on one system (my ...
    (Focus-Linux)
  • Re: what is the best way to determine system OS?
    ... If you watch a typical autoconf script, ... >knowing which features you're looking for, I can't say how you would ... >"better" distribution that you already support, ...
    (comp.lang.python)
  • Re: Script urgent
    ... objLog.Write strMail & vbCrLf ... Name and Distribution list. ... If you have multiple servers and need to automate use the script ... You will need to modify the line to enter your domain ...
    (microsoft.public.exchange.admin)
  • Re: choosing between ipcop and iptables
    ... I had never heard of ipcop before, ... of another distribution and continue using the other distribution. ... Iptables is part of any normal distribution. ... if both the distribution startup scripts and your script try ...
    (comp.os.linux.security)