delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/09/27/09:12:04

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3BB32564.F092C68@cportcorp.com>
Date: Thu, 27 Sep 2001 09:11:00 -0400
From: Peter Buckley <peter DOT buckley AT cportcorp DOT com>
X-Mailer: Mozilla 4.7 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: "Karr, David" <david DOT karr AT cacheflow DOT com>, cygwin AT cygwin DOT com
Subject: Re: Slightly different interpretation of $PATH between Bash and Perl
References: <2C08D4EECBDED41184BB00D0B74733420473F0CD AT cf-bay-exch-03 DOT cacheflow DOT com>

IIRC system() in perl does the same thing as make invoking a shell. It 
uses ash (sh) instead of bash. It sounds like things are different
because 
of the two different shells being used. 

I don't remember if it is recommended, but I have heard people say that 
you can make a copy of bash.exe and rename it to sh.exe and delete or 
rename the old sh.exe so perl and make will use bash instead of ash. 

HTH,
Peter

"Karr, David" wrote:
> 
> I have a Bash script in $HOME/bin that runs "$(basename $0)" (essentially).
> This works fine when I run it from Bash (1.3.2).
> 
> I also have a Perl script, run from Cygwin Perl, that uses the "system()"
> command to run the same script.  This executes slightly differently from the
> previous.
> 
> In particular, "$0" in the script, when run directly from Bash is
> "/home/david.karr/bin/<scriptname>".  However, "$0" in the script, when I
> run it from Cygwin Perl, is "c:\cygwin\home\david.karr\bin\<scriptname>".
> 
> My workaround for this is to always retrieve '$(cygpath -u $0}', but I'd
> like to understand a little better why this is happening.
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/

-- 
Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now?  [OK]

--

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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