FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 08-26-2010, 01:27 AM
"Oliver Schneider"
 
Default Tell Ubuntu and Debian apart in a shell script ...

> 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: <http://ddkwizard.assarbad.net/trunk/ddkbuild.cmd>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100826012730.45830@gmx.net">http://lists.debian.org/20100826012730.45830@gmx.net
 
Old 08-27-2010, 12:08 AM
T o n g
 
Default Tell Ubuntu and Debian apart in a shell script ...

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 script depends on lsb_release, then it is specific to your
setting.

> Still looking,

How about /etc/rc.local

I have such file (yet still wondering where it comes from), which says,

# By default this script does nothing.

And it seems to me that Ubuntu doesn't have it [1].

Any comment?

1. https://help.ubuntu.com/community/RcLocalHowto

--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: i56vmc$3dn$1@dough.gmane.org">http://lists.debian.org/i56vmc$3dn$1@dough.gmane.org
 
Old 08-27-2010, 02:31 AM
Kevin Ross
 
Default Tell Ubuntu and Debian apart in a shell script ...

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 testing and I don't have it.
So if your script depends on lsb_release, then it is specific to your
setting.


I just checked, it comes from the lsb-release package, the priority of
which is optional.


To Oliver: if you're making a .deb package for your program, you could
add lsb-release to its list of dependencies.



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4C772369.8080901@familyross.net">http://lists.debian.org/4C772369.8080901@familyross.net
 
Old 08-27-2010, 02:39 AM
Jordon Bedwell
 
Default Tell Ubuntu and Debian apart in a shell script ...

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 lsb_release mandatory? I'm using latest testing and I don't have it.
So if your script depends on lsb_release, then it is specific to your
setting.


I just checked, it comes from the lsb-release package, the priority of
which is optional.


To Oliver: if you're making a .deb package for your program, you
could add lsb-release to its list of dependencies.




Could you not just use the uname command?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4C77255C.1050602@envygeeks.com">http://lists.debian.org/4C77255C.1050602@envygeeks.com
 
Old 08-27-2010, 08:28 AM
Alexey Salmin
 
Default Tell Ubuntu and Debian apart in a shell script ...

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 idea to check for some specific functionality you
need in your script rather than rely a on distribution name from some
file in /etc.
Or you need that just for nice output/logging?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTin3TeqMoZZrk6LQL0rzan47BH=ak6J5+fMcS6Vy@mail .gmail.com">http://lists.debian.org/AANLkTin3TeqMoZZrk6LQL0rzan47BH=ak6J5+fMcS6Vy@mail .gmail.com
 
Old 08-27-2010, 11:07 PM
Ron Johnson
 
Default Tell Ubuntu and Debian apart in a shell script ...

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 IE, FF, Safari, etc.


--
Seek truth from facts.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4C78454D.9050208@cox.net">http://lists.debian.org/4C78454D.9050208@cox.net
 

Thread Tools




All times are GMT. The time now is 08:36 PM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org