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

G. Matthew Rice matt-s/rLXaiAEBtBDgjK7y7TUQ at public.gmane.org
Tue Mar 22 15:11:41 UTC 2011


On Tue, Mar 22, 2011 at 11:06 AM, Digimer <linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org> wrote:
>> Ideally I'd like to be able to detect that I'm about to compile on the MAC
>> inside the Makefile (or at least in the install script).    Any ideas on how
>> one could reliably detect a Linux OS as opposed to a Mac OS?
>>
>> Thanks in advance for your help.
>
> Though it's not technically it's purpose; I've had good luck checking
> /etc/issue for distro name and version info.

I have to agree here.  /etc/issue has also been the most reliable way
to detect the linux distro.

Also, it maybe time to start looking at tools like autoconf.

Regards,
-- 
G. Matthew Rice <mrice-WHMkLBA7RDE at public.gmane.org>                         gpg id: EF9AAD20
--
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