Re: If you're using linux can you run this command please?
- Posted by xecronix Sep 01, 2015
- 2254 views
I was actually trying to concat any file that matched the pattern *-release looking for NAME=. The hope was that no matter what the distro named the file, the NAME= pattern would find the name of distro. I found something using Google that put me on the path of this oneliner. Sadly, it turned out to be false for several reasons. First Mint actually supplements distro with their own release file. So, NAME= still means Ubuntu. That doesn't adversely affect the reason I wanted to know what distro but, it opened my eyes to other problems. As Jean-Marc pointed out in his responses, the simple one liner becomes a lot more complicated with the addition of Linux distros. Coupled with the fact that there may be multiple *-release files, there is also the possibility of *-release directories. At the moment, I'm not interested in those directories or content.
In any case, too me it seemed clearer to use cat | grep for what I wanted at the time. What I wanted to express with cat /etc/*-release | grep ^NAME was the following English expression.
"Somewhere in the /etc directory there should be a file that looks like *-release. Find the single line in whatever that file is that begins with NAME=. It holds the single value I'm interested in at the moment."
Unfortunately, this plan didn't work. So I revised my plan. I appreciate all of you and the time you took to answer my question.