need a good way to determine the OS from a BASH script

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Tue Mar 22 17:06:18 UTC 2011


On Tue, Mar 22, 2011 at 11:15:39AM -0400, Digimer wrote:
> On 03/22/2011 11:07 AM, Vic Gedris wrote:
> > "uname" is your friend for this.
> > 
> > $ uname
> > Linux
> > 
> > $ uname
> > SunOS
> > 
> > ..etc..  Not sure what it reports for MacOS...
> 
> OS X returns the name of the OS X release (ie: Darwin), and no
> /etc/issue exists. Look into /etc/lsb_release (man 1 lsb_release).

How about uname -s or uname -o?

-- 
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list