Finding help for a problem in the Open Source world often involves search engines, filtering out random rants, and all too often finding something that does not work, as it was only appropriate four years ago. Which is I put publication dates at the top of my infrequent posts.
This is a problem in my older notes files, of which there are many.
$ find $notes -type f | wc -l
It's not uncommon to find something that dates back ten years. It isn't a horrible problem, as modification times are in the files, so it's easy to spot. And no, I am not going to put that whole hierarchy under version control. Currently, it's too much overhead, given the way that I use that hierarchy.
For the past several years, I've dealt with the applicability issue with a shell alias in my .bashrc.
date; cat /etc/redhat-release
Thu Jul 9 10:21:16 PDT 2015
Fedora release 21 (Twenty One)
I just paste the output into the doc. Or the bug report, or whatever. I recommend it to clients who are sending me bug reports, and some form of it is pushed to everything in the lab. I say 'some form' because in certain situations it may make more sense to output on a single line, change the date format to seconds since the epoch, or whatever.
Some variant of /etc/*-release is available in most Linux distributions, not just the families related to Red Hat (CentOS, Fedora, etc.). It might take other forms, such as /etc/lsb-release. Or even /etc/issue. And no matter which side of the systemd controversy you might fall on, it has at least provided /etc/os-release. Though that provides 'ANSI_COLOR=' which gets very near to one of my pet hatreds.
It might even take the form of a command, such as 'lsb_release <options>'
http://www.freedesktop.org/software/systemd/man/os-release.html. I note that freedesktop.org has done a Bad Thing here, though, in that they have made CPE_NAME= optional. Common Platform Enumeration is a standard worth supporting, if you ever expect to be glueing the output of disparate
security information and event management (SIEM) tools together.
It's not really complicated
Really. To the beginner, it might seem that way, but it really isn't.
- Search for files in /etc/, such as /etc/*-release. or /etc/issue
- Search for commands, via something like 'which lsb_release'
- Look at the results
- Spend about 10 minutes thinking about it
- Drop in a shell alias, or a quick script (in your $PATH, so it Just Works)
- Profit! Better docs, better bug reports
- There is no 7