delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/06/28/10:33:20

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <4.3.2.7.0.20000628094415.00b0e510@courriel.polymtl.ca>
X-Mailer: QUALCOMM Windows Eudora Version 4.3.2
Date: Wed, 28 Jun 2000 10:07:20 -0400
To: "Christopher Jones" <cbjones AT nortelnetworks DOT com>
From: Andre Bleau <andre DOT bleau AT courriel DOT polymtl DOT ca>
Subject: RE: bash PATH problem [WAS:gdb 20000610 crashes]
Cc: cygwin AT sourceware DOT cygnus DOT com
In-Reply-To: <C9A8E1D07093D111B76A0000F8C9918A03BD567A@zrtpd003.us.norte
l.com>
Mime-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id KAA20788

At 16:24 2000-06-27 -0400, you wrote:

>Try duplicating the problem with a simple shell script.
>
>#!/bin/sh
>echo $0
>exit 0
>
>I tried it and couldn't reproduce it in bash.exe or sh.exe.
>
>Brian

I can't duplicate it with a shell script, but I made some progress in 
locating the problem; I found that I had both a gdb and a gdb.exe in 
/usr/lib; these two seems to "cancel" each other and the gdb.exe from the 
end of the PATH is called instead. Here is some test code reproducing the 
problem:

hello.c:

         #include <stdio.h>
         #ifndef NUMBER
         #define NUMBER 0
         #endif
         int main()
         {
         printf("Hello number %d\n", NUMBER);
         return 0;
         }

         gcc hello.c -DNUMBER=1 -o /usr/bin/hello
         gcc hello.c -DNUMBER=2 -o /tmp/hello
         PATH=/usr/bin:/tmp
         hello
         Hello number 1

So far, so good. Now here is the trick:

         cd /usr/bin
         cp hello.exe hello
         PATH=/usr/bin:/tmp
         hello
         Hello number 2

Gotcha. hello and hello.exe from /usr/bin are both ignored in favor of 
hello.exe in /tmp, despites the PATH order.



André Bleau, ing., analyste
bleau AT courriel DOT polymtl DOT ca

Département de génie électrique et         Electric Engineering and
de génie informatique                      Computer Engineering department
École Polytechnique de Montréal            Montreal Polytechnic School


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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