Mail Archives: djgpp-workers/2003/01/09/04:10:14
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 -