Subject: Re: test(1) ?!
To: Hauke Fath <hf@melog.de>
From: Simon Burge <simonb@netbsd.org>
List: tech-userlevel
Date: 06/27/2000 21:48:04
Hauke Fath wrote:

> Hi,
> 
> I need to write a shell script that runs on several NetBSD versions.
> 
> >From `man test`:
> 
> 
> (NetBSD 1.4)
> 
>      -h file       True if file exists and is a symbolic link.  This operator
>                    is retained for compatibility with previous versions of
>                    this program. Do not rely on its existence; use -L instead.
> 
> [...]
> 
>      -L file       True if file exists and is a symbolic link.
> 
> 
> 
> (NetBSD 1.5)
> 
>      -h file       True if file exists and is a symbolic link.
> 
> [...]
> 
>      -L file       True if file exists and is a symbolic link.  This operator
>                    is retained for compatibility with previous versions of
>                    this program. Do not rely on its existence; use -h instead.

FWIW, -h and -L aren't in SUSv2, and the Solaris man page says:

	-h ....
	-L _exact_ same text as -h
	...
        The -L option is a migration aid for users of other shells
        which have similar options and may not be supported in future
        releases.

I guess -h is the best bet then...

Simon.