The /etc/redhat-release file should be owned by root, with only root having modify permissions. So I wouldn't worry too much about the file changing. If you think about it, this file was probably added for exactly the purpose you are describing. That is, there is no standard Linux command to get Distribution specific information.
Life is good on the Ponderosa,<br />but mind where you step.
It's true. Only root should be able to modify the /etc/redhat-release file. However, some releases of Oracle were known to check that file to see if the system was running an Oracle-supported release. Since Oracle doesn't support Fedora, people would temporarily modify the /etc/redhat-release file to make it present an Oracle-blessed release name while the installer ran if they wanted to play with Oracle on a Fedora box.
Some confusion here: The OS release is NOT the distro release, and neither of the above are "desktop" releases. The uname command lists the OS (kernel) release, the /etc/redhat-release file lists the Red Hat OS release (other vendors have their own ways of doing this). But the Desktop is ONLY available on machines running the X window system. There's no such thing as a command-line "desktop"; about the closes you'll get is a choice of shells.
Speaking of choices, when you log in via an X terminal, your login script will usually start up some sort of desktop. Most commonly, this is KDE or Gnome, but it can be other systems, such as Sawfish, especially for smaller systems where the heavy resource demands of a "fat" desktop like KDE or Gnome are too much.
The Desktop used is determined PER USER. That is, I may login and use KDE, someone else may be logged in from another X terminal using Gnome. Red Hat has a command named "switch-desktop" that allows the user to select which desktop to use. Each of these Desktop systems comes from a different project, so their release numbers are totally unrelated to each other or to the distro and kernel release numbers.
If you want to determine what version of Gnome is installed on a particular Red Hat or Fedora system, you can use the rpm command to return the version info on the gnome-desktop package. That will tell you what version of Gnome is installed in the rpm database.
An IDE is no substitute for an Intelligent Developer.
Joined: Dec 27, 2002
You could also check the result of "rpm -q redhat-release", just in case the file was modified. Just a thought! [ July 05, 2007: Message edited by: Darrin Cartwright ]