delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/01/09/04:10:14

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3E1D3BDE.C5BDCF79@phekda.freeserve.co.uk>
Date: Thu, 09 Jan 2003 09:07:42 +0000
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Re: m4 port: return program name as 'm4' not '/some/path/m4.exe' [PATCH]
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1030109075038 DOT 16256B-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Eli Zaretskii wrote:
> 
> On Wed, 8 Jan 2003, Richard Dawe wrote:
> 
> > > > With or without the '.exe'?
> > >
> > > Depends if "test -f foo" finds foo.exe, along with other common things
> > > that look for files.
> >
> > "test -f foo" won't find foo.exe. "test -x foo" will find foo.exe
> 
> "test -f foo" _will_ find foo.exe if you set TEST_FINDS_EXE=y.

But can you rely on that being set? For configure: config.site for autoconf
2.13 port and earlier: yes; config.site for autoconf 2.50 and later: no.

Does anyone run with TESTS_FIND_EXE set to y all the time? (I try to avoid
setting environment variables that make programs behave specially.)
 
> > but Tim van
> > Holder (hi Tim) told me the other day that it'll find directories called
> > "foo" in the path as well.
> 
> Isn't that a bug?  Does that happen on Unix and GNU/Linux systems as
> well.

test -x doesn't seem to find directories on my RedHat 6.2 box: first check
whether it finds a directory off one of the directories in $PATH; then check
whether it finds a directory called 'bin' in the path (of which there are
several):

iolanthe:~ =] ls -ld ~/bin/get-cvs
drwxrwxr-x    3 rich     rich         4096 Dec 31 00:10
/home/rich/bin/get-cvs/
iolanthe:~ =] echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/rich/bin
iolanthe:~ =] test -x get-cvs && echo 'test -x finds a directory! Abandon
ship!'
iolanthe:~ =] cd src/
iolanthe:~/src =] ls -ld bin
ls: bin: No such file or directory
iolanthe:~/src =] test -x bin && echo 'test -x finds a directory! Uh-oh!'
iolanthe:~ =] rpm -q sh-utils
sh-utils-2.0-5

Bye, Rich =]

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


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