Re: Tell Ubuntu and Debian apart in a shell script ...

2010-08-27 Thread Alexey Salmin
Debian vs Ubuntu is not the same as Debian vs say RedHat. Sometimes it's hard to tell them apart even by hand because you can easily mix deb packages between them if you want. It can be Debian with package X from Ubuntu. Or it can be Knoppix dist-upgraded to Debian. Generally I think it's a good

Re: Tell Ubuntu and Debian apart in a shell script ...

2010-08-27 Thread Ron Johnson
On 08/27/2010 03:28 AM, Alexey Salmin wrote: [snip] think it's a good idea to check for some specific functionality you need in your script rather than rely a on distribution name from some file in /etc. This is Best Practices when writing a web page: check for functionality, not whether it's

Re: Tell Ubuntu and Debian apart in a shell script ...

2010-08-26 Thread T o n g
On Thu, 26 Aug 2010 02:03:55 +0200, Oliver Schneider wrote: (which lsb_release /dev/null `which lsb_release` --id)|awk '{print $3}' ... does not work on older systems which don't have lsb_release, though. Is lsb_release mandatory? I'm using latest testing and I don't have it. So if your

Re: Tell Ubuntu and Debian apart in a shell script ...

2010-08-26 Thread Kevin Ross
On 8/26/2010 5:08 PM, T o n g wrote: On Thu, 26 Aug 2010 02:03:55 +0200, Oliver Schneider wrote: (which lsb_release /dev/null `which lsb_release` --id)|awk '{print $3}' ... does not work on older systems which don't have lsb_release, though. Is lsb_release mandatory? I'm using latest

Re: Tell Ubuntu and Debian apart in a shell script ...

2010-08-26 Thread Jordon Bedwell
On 8/26/2010 9:31 PM, Kevin Ross wrote: On 8/26/2010 5:08 PM, T o n g wrote: On Thu, 26 Aug 2010 02:03:55 +0200, Oliver Schneider wrote: (which lsb_release /dev/null `which lsb_release` --id)|awk '{print $3}' ... does not work on older systems which don't have lsb_release, though. Is

Tell Ubuntu and Debian apart in a shell script ...

2010-08-25 Thread Oliver Schneider
Is something on the lines of: cat /etc/apt/sources.list|grep '^deb '|grep 'http://security\.'|head -n 1|grep -o 'debian|ubuntu' a safe idea or does it already make too many assumptions? Otherwise, what methods do you use to tell them apart from the shell? Thanks, // Oliver --

Re: Tell Ubuntu and Debian apart in a shell script ...

2010-08-25 Thread Kevin Ross
On 08/25/2010 04:47 PM, Oliver Schneider wrote: Is something on the lines of: cat /etc/apt/sources.list|grep '^deb '|grep 'http://security\.'|head -n 1|grep -o 'debian|ubuntu' a safe idea or does it already make too many assumptions? Otherwise, what methods do you use to tell them apart

Re: Tell Ubuntu and Debian apart in a shell script ...

2010-08-25 Thread Oliver Schneider
Hi again, Can you look in /etc/issue (or maybe /etc/debian_version)? As a matter of fact that was my first naive method. It does work for Debian (unless changed by someone), but on Ubuntu this always contains the same string as far as I saw squeeze/sid. However, it could be that I'm on to

Re: Tell Ubuntu and Debian apart in a shell script ...

2010-08-25 Thread Kevin Ross
On 08/25/2010 05:03 PM, Oliver Schneider wrote: Hi again, Can you look in /etc/issue (or maybe /etc/debian_version)? As a matter of fact that was my first naive method. It does work for Debian (unless changed by someone), but on Ubuntu this always contains the same string as far as I saw

Re: Tell Ubuntu and Debian apart in a shell script ...

2010-08-25 Thread Oliver Schneider
Maybe use lsb_release, and grep /etc/apt/sources.list as a fallback method? Yep, sounds like a plan. Thanks, // Oliver -- --- DDKWizard and DDKBUILD: http://ddkwizard.assarbad.net Trunk (potentially unstable) version: