On 10/03/2013 03:36 PM, vic...@vsespb.ru wrote:
> пятница, 4 октября 2013 г., 1:27:28 UTC+4 пользователь Greg Wooledge написал:
>> I assume you mean that bash will return 1 (failure) for [[ -e /path/to/file 
>> ]]
> 
> yes
> 
>> How else would you expect bash to handle this?
> 
> Point was that it's probably poorly documented: "-e True if file exists." ( 
> http://www.gnu.org/software/bash/manual/bash.html ).
> 
> It's not immediately clear that false is returned if file exists but 
> permission denied error happens.

For all intents and purposes, if you don't have permission to stat a
file, then it may as well not exist.  Treating permission denied as not
existing is perfectly logical.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to