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: Peter Eisentraut
Subject: Re: Problems with test -L on Solaris
Date: Sun, 22 Apr 2001 20:05:38 +0200 (CEST)

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 ...

-- 
Peter Eisentraut   address@hidden   http://funkturm.homeip.net/~peter




reply via email to

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