LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-13-2005, 02:17 AM   #1
shifty_eyes
LQ Newbie
 
Registered: Sep 2005
Location: Victoria, B.C
Distribution: Slackware
Posts: 11

Rep: Reputation: 0
Distro Information from Bash


Hi, I'm working on a superkaramba theme and I was wondering if there is a way to determine which specific distro a person is using. Is there maybe some obscure file or enviroment variable that holds this information? Or possibly a script that tries to guess based on the systems configuration floating around the internet?

Thanks
 
Old 10-13-2005, 02:37 AM   #2
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Code:
cat /proc/version
*should* give you some version-specific information. At least you should be able to parse the string that returns to get a clue or an idea.
 
Old 10-13-2005, 02:38 AM   #3
teebones
Member
 
Registered: Aug 2005
Location: /home/teebones
Distribution: sometimes this, sometimes that..
Posts: 502

Rep: Reputation: 56
And if above doesn't work (wich is hardly the case):

Most likely you will find a file in /etc, called something like "<distro>_version". Let your program search for such file, and cat the output. Though, i must add, that it's distro dependent. Some use another file for this.

Another way might be the uname -a command. This might give you some usefull info too.

Last edited by teebones; 10-13-2005 at 02:40 AM.
 
Old 10-13-2005, 02:51 AM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Code:
$cat /etc/DistroName-release
 
Old 10-13-2005, 05:16 AM   #5
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Code:
uname --operating-system
seems to give the string without all the extra information. It would be useful too.
 
Old 10-13-2005, 04:34 PM   #6
shifty_eyes
LQ Newbie
 
Registered: Sep 2005
Location: Victoria, B.C
Distribution: Slackware
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks for all the replies guys
On my box (Slackware 10.1) the most promising thing so far is the slackware-version file in /etc. Everything else just gives me GNU/Linux. I guess ill just write a script to grep around in /etc for simmiler files for the more mainstream distros, and if that dosnt work for someone i guess they'll just have to change the .theme file themselves. Isn't opensource great?

Thanks again
 
Old 10-13-2005, 07:31 PM   #7
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
For Arch Linux, the file is /etc/arch-release
 
Old 10-13-2005, 08:18 PM   #8
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
I'm using Slackware 10.0. Where does the uname information come from? (i.e. where is it set to say GNU/Linux?)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to preserve user account information when replacing Linux distro? farnell_mark Linux - Newbie 4 03-28-2005 09:51 PM
Bash information os2 Programming 2 03-21-2005 12:38 AM
Need Distro Information AEGIS Hero Linux - Newbie 3 02-18-2005 11:42 AM
Information on patches for older RedHat distro versions jason.hewitt Red Hat 3 12-13-2004 04:06 AM
Bash: Extract Title Information From Playlist xxfunkxx Linux - Newbie 5 07-28-2004 02:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration