bug-bash
[Top][All Lists]
Advanced

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

Re: -e and permission denied


From: Eric Blake
Subject: Re: -e and permission denied
Date: Thu, 03 Oct 2013 16:11:51 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

On 10/03/2013 03:36 PM, victor@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

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