libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with test -L on Solaris


From: Gary V . Vaughan
Subject: Re: Problems with test -L on Solaris
Date: Mon, 23 Apr 2001 21:09:34 +0100

On Monday 23 April 2001  2:23 am, address@hidden wrote:
> On Sun, Apr 22, 2001 at 08:05:38PM +0200, Peter Eisentraut wrote:
> > Albert Chin-A-Young writes:
> > > > Try changing the code to look like this:
> > > >
> > > >     if test -L "$file" >/dev/null 2>&1 || test -h "$file" >/dev/null
> > > > 2>&1 || test -f "$file"; then
> > >
> > > Well, examine the following:
> > >   $ /bin/sh
> > >   $ test -X "/etc/passwd" || echo foo
> > >   test: argument expected
> > >   $ test -L "/etc/passwd" || echo foo
> > >   test: argument expected
> > >
> > > Because the "echo foo" never gets called, it doesn't matter what is
> > > placed after ||.
> >
> > That's a peculiar shell.  How about this:
> >
> > if test -L "$file" >/dev/null 2>&1; then
> >
> > elif test -h "$file" >/dev/null 2>&1; then
> >
> > elif test -f "$file"; then
> >
> > elif ...
>
> No. But this will work:
>   if (test -L "$file") >/dev/null 2>&1 || \
>   (test -h "$file") >/dev/null 2>&1 || \
>   test -f "$file"; then
>
> I've already tested it. I'll contribute the patch soon.

Me too!  Already applied.  Thanks.

Cheers,
        Gary.
-- 
  ___              _   ___   __              _         mailto: address@hidden
 / __|__ _ _ ___ _| | / / | / /_ _ _  _ __ _| |_  __ _ ___       address@hidden
| (_ / _` | '_|// / |/ /| |/ / _` | || / _` | ' \/ _` | _ \
 \___\__,_|_|\_, /|___(_)___/\__,_|\_,_\__, |_||_\__,_|//_/
home page:  /___/                      /___/                  gpg public key:
http://www.oranda.demon.co.uk           http://www.oranda.demon.co.uk/key.asc



reply via email to

[Prev in Thread] Current Thread [Next in Thread]