Re: [Documentation] -d returns true for symlink to directory
From:
Greg Wooledge
Subject:
Re: [Documentation] -d returns true for symlink to directory
Date:
Thu, 21 Jul 2016 12:04:17 -0400
User-agent:
Mutt/1.4.2.3i
On Thu, Jul 21, 2016 at 05:56:13PM +0200, Reuti wrote:
> While we are on this: wondering about the difference about -h and -L I found
> that `man test` outputs on OS X:
>
> " -h file True if file exists and is a symbolic link. This
> operator is retained for compatibility with pre-
> vious versions of this program. Do not rely on its
> existence; use -L instead."
>
> while on Linux `man test` just states that it's the same. Is there any
> preference which one should be used for the bash builtin?
POSIX documents both -h and -L
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
It doesn't appear to give any preference for one over the other. I don't
even see anything in the Rationale. I don't know why the OS X man page
is deprecating one of them over the other.