how to find out RHEL or Centos from makefile

Comments, suggestions, compliments, etc
Post Reply
anoopbindal
Posts: 2
Joined: 2014/08/22 20:06:41

how to find out RHEL or Centos from makefile

Post by anoopbindal » 2014/08/22 20:11:38

Hi
I am looking for some command which can tell if system is RHEL or Centos. Like getconf LONG_BIT gives whether system is 32 bit or 64 bit.
I need it to change the steps in makefile for c code.

Thanks

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how to find out RHEL or Centos from makefile

Post by TrevorH » 2014/08/22 21:02:48

Do you to tell apart RHEL from CentOS or to tell if the system you are building on is either one?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

anoopbindal
Posts: 2
Joined: 2014/08/22 20:06:41

Re: how to find out RHEL or Centos from makefile

Post by anoopbindal » 2014/08/25 14:19:37

I want to do different things for RHEL and Centos. So want to know if current OS is CentOS or Rhel.
i know there is a file /etc/centos-release but is there anything cleaner then checking for this file.
I want to to tell apart RHEL from CentOS.

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: how to find out RHEL or Centos from makefile

Post by avij » 2014/08/25 17:25:43

Checking /etc/os-release might be marginally cleaner.

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how to find out RHEL or Centos from makefile

Post by TrevorH » 2014/08/30 22:05:43

Why would you need to tell them apart? They are to all intents and purposes (and by design) identical!
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

schotty
Posts: 19
Joined: 2014/08/22 20:31:16
Location: Milwaukee, WI
Contact:

Re: how to find out RHEL or Centos from makefile

Post by schotty » 2014/10/15 23:06:15

avij wrote:Checking /etc/os-release might be marginally cleaner.
Thats a good bet for this. Oracle reports as RHEL though.

CentOS Workstation

Code: Select all

[andrew@big-red ~]$ cat /etc/redhat-release 
CentOS Linux release 7.0.1406 (Core) 
[andrew@big-red ~]$ cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

[andrew@big-red ~]$ 
Oracle VM

Code: Select all

[andrew@vm0 ~]$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.5 (Santiago)
[andrew@vm0 ~]$ cat /etc/os-release
cat: /etc/os-release: No such file or directory
[andrew@vm0 ~]$ 

Post Reply