delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/04/04/05:04:45

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=0.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_THEBAT,KHOP_THREADED
X-Spam-Check-By: sourceware.org
Date: Wed, 4 Apr 2012 13:01:24 +0400
From: Andrey Repin <anrdaemon AT freemail DOT ru>
Reply-To: Andrey Repin <cygwin AT cygwin DOT com>
Message-ID: <103388385.20120404130124@mtu-net.ru>
To: Warren Young <warren AT etr-usa DOT com>, cygwin AT cygwin DOT com
Subject: Re: Is this supposed to work this way?
In-Reply-To: <4F7BC6B1.8030506@etr-usa.com>
References: <0105D5C1E0353146B1B222348B0411A20A6536CB91 AT NIHMLBX02 DOT nih DOT gov> <602324786 DOT 20120404044708 AT mtu-net DOT ru> <4F7B9C81 DOT 4060209 AT redhat DOT com> <696106181 DOT 20120404053558 AT mtu-net DOT ru> <4F7BC6B1 DOT 8030506 AT etr-usa DOT com>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Greetings, Warren Young!

>> what is the standard way of detecting OS type?
>> uname -o
>> ?

> The wise try not to do that at all.

> Instead, take in a little wisdom from the people who created autoconf, a 
> piece of software that's been uncommonly successful[*] by FOSS 
> standards: don't test for platforms, test for features.

Well, then, following your wisdom, I have to clog every line of my script with
"... || exit" or an equivalent.

Because even an attempt to continue execution, if any error occured, would be
disastrous to the calling program.
Solution is to "set -e" and have script bail out at any problem, but if I try
autoconf approach and blindly run whatever I feel appropriate, hoping for the
best and preparing for worst, I won't have such option.


--
WBR,
Andrey Repin (anrdaemon AT freemail DOT ru) 04.04.2012, <12:57>

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019