delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/07/11/12:00:18

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 11 Jul 2008 11:59:50 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: programming API to determine whether in "Cygwin environment"
Message-ID: <20080711155950.GD5342@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <18395872 DOT post AT talk DOT nabble DOT com> <0C260F619E428642BFA6380177C3ADF3067B484B AT exmsea005 DOT us DOT wamu DOT net>
MIME-Version: 1.0
In-Reply-To: <0C260F619E428642BFA6380177C3ADF3067B484B@exmsea005.us.wamu.net>
User-Agent: Mutt/1.5.16 (2007-06-09)
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

On Fri, Jul 11, 2008 at 08:34:17AM -0700, Karr, David wrote:
>The "ant" shell script checks to see if "`uname`" contains the string
>"CYGWIN". 

That just means that you have a Cygwin uname in your path.  It doesn't
mean you're necessarily running in a Cygwin "environment".  I thought the
intent was to print c:\foo at the CMD prompt and /cygdrive/c/foo when
running under some shell.

So, really the best test for that is the SHELL environment variable
containing just '/' and no '\' or ':'.  The Cygwin DLL doesn't mess with
that environment variable.

cgf

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

- Raw text -


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