bug-bash
[Top][All Lists]
Advanced

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

Re: [Documentation] -d returns true for symlink to directory


From: Reuti
Subject: Re: [Documentation] -d returns true for symlink to directory
Date: Thu, 21 Jul 2016 17:56:13 +0200

Hi,

> Am 21.07.2016 um 15:39 schrieb Greg Wooledge <wooledg@eeg.ccf.org>:
> 
> On Wed, Jul 20, 2016 at 04:43:13PM -0700, Adam McKenna wrote:
>>       -d file
>>              True if file exists and is a directory.
>> 
>> The operator also returns True if the file exists and is a symlink to a
>> directory
> 
> Yes.  All of the file-testing operators follow a symlink, EXCEPT for the
> ones that specifically test whether the operand is a symlink (-h and -L).

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?

-- Reuti


reply via email to

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