LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (https://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   /etc/redhat-release file on other distributions? (https://www.linuxquestions.org/questions/linux-distributions-5/etc-redhat-release-file-on-other-distributions-313174/)

The Joker 04-14-2005 09:38 AM

/etc/redhat-release file on other distributions?
 
Ok, I'm writing an application that finds out some basic information about the computer and then stores it in an XML file for future reference, and one of the things it tracks down is which distribution the computer has. The code I use for this is a simple If clause that checks for a "etc/redhat-release", "etc/mandrake-release", "etc/slackware-version" etc. etc. file and then prints the contents of the file it finds. However, I've heard that some distributions other than redhat may have a "redhat-release" file for compatibility reasons. My question is, what does the redhat-release file on a different distribution contain? (I.e what would the output of "cat /etc/redhat-release" be?) I can just put the "etc/redhat-release" check last to not have to worry about this, but I'm still curious.

Thanks in advance.

john2 04-15-2005 10:38 AM

The /etc/redhat-release files in Mandrake and Centos contain the correct information for the distro - I think they just link to /etc/mandrake-release and /etc/centos-release respectively but I haven't got access at the moment to a machine running these distros to confirm this.

The Joker 04-18-2005 03:17 AM

Oh, so then it doesn't really matter which file I take the info from in the first place. Ok, thanks!

Another question, do you (or anyone) know if certain distros might contain extra release files other than redhat-release?


All times are GMT -5. The time now is 10:42 AM.