Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15525

Re: -e test description in the GNU Bash 5.0 man page from 7 December 2018

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Marco Ippolito <maroloccio@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: -e test description in the GNU Bash 5.0 man page from 7 December 2018
Date Mon, 21 Oct 2019 12:00:52 +0200
Lines 72
Approved bug-bash@gnu.org
Message-ID <mailman.1358.1571652080.9715.bug-bash@gnu.org> (permalink)
References <6f5fd3b2-2e3b-4730-b2d8-50b89e9e3085@gmail.com> <mvmd0eqa2f8.fsf@suse.de> <92968c0e-677a-4830-54ae-5e172336cf12@gmail.com>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
X-Trace usenet.stanford.edu 1571652081 18856 209.51.188.17 (21 Oct 2019 10:01:21 GMT)
X-Complaints-To action@cs.stanford.edu
Cc chet.ramey@case.edu, bug-bash@gnu.org
To Andreas Schwab <schwab@suse.de>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=gEWgXnOjth95nN0DM8l+YR8tkOwQIEVf1byiMJYAB9Q=; b=i1DWhDL7P4DKnyAAm1emu6aCLi0rAAPrPxbNOIVXSGUUfKJ6fVlNn6TvJ+i3tTRFFM NY8lFjx7Y1RXPNwKlVDhf3WiI/ehuwa2sc9/4SYt0EjFnMswLjhz6E5q+ihEMlFzIuCB n02i+mPbeEEFQt0PG1v38JdG30mEjiMs5I/I1XSNju1T7KLAQgL7IUrmbZk6MkBoOEZ1 qTYuuSCzjJngoSr9ovr5Ue1g8UFadmP9jeXxKUPPMyrGhMUVkUt7UDsznb3oRNKWOWsw ub0TBrdITJ8MZ8iXMMJ1vZRl8jHSZtT9Qq5IE+gsVXPgs7jCKq/6VwU6chKugO663MFs qw+g==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=gEWgXnOjth95nN0DM8l+YR8tkOwQIEVf1byiMJYAB9Q=; b=kO7qThMBhNwMeGCHyksY2q9AOfL73bGsrbg8SLTrj5fOrKUnFAmdBm4XlSAR39l7qo YSsKxeSRa0KtJLkkq1cQrvQE935uJiAIu9OMR35hITP9TXIFpNuccx4O/F2LYEl2M5Zp VzRcnCXKTfhqTlhwlAD3Com4IRjl69jcdEkaO2wDNKn6cx+LbQx4XAbL/gmlADSCHcLc O0jB3Ecacgo+X5PWkCXLqVuMpXHt7m6BsW9XXI8KFIbjsYA6r1dtRpzINRxnZ7fknY5x R/a/HJBQWyuJbVn6TzJrT0AhlNbE6cOmR7+7pPmEljtx4R7LpdszxYhXoe+pnrtNEL0e UzdA==
X-Gm-Message-State APjAAAX7nP5KyGupYDv+OOYrW6wjCFfHlfovv6YRVISqQ8CBOoJgjgLU E7wI2NkloaVUEMRKc7QW9fL9MDyH
X-Google-Smtp-Source APXvYqzrBF3mnezE7cUnc35r0t2w1rZdPbFTHHGOoJzUoxym/e9VRWfhF1pGP6XAOGwcZnmM+ogjTg==
X-Received by 2002:a5d:51c3:: with SMTP id n3mr19197120wrv.5.1571652054842; Mon, 21 Oct 2019 03:00:54 -0700 (PDT)
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0
In-Reply-To <mvmd0eqa2f8.fsf@suse.de>
Content-Language en-GB
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2a00:1450:4864:20::444
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <92968c0e-677a-4830-54ae-5e172336cf12@gmail.com>
X-Mailman-Original-References <6f5fd3b2-2e3b-4730-b2d8-50b89e9e3085@gmail.com> <mvmd0eqa2f8.fsf@suse.de>
Xref csiph.com gnu.bash.bug:15525

Show key headers only | View raw


On 21/10/2019 11:11, Andreas Schwab wrote:
> On Okt 21 2019, Marco Ippolito wrote:
>
>> In the GNU Bash 5.0 man page from 7 December 2018 the -e test is
>> documented as such:
>>
>>         -e file
>>                True if file exists.
>>
>> When "file" is a symlink name to a non-existing target, the -e test fails,
>> and this may be surprising from just reading the documentation.
> It also says:
>
>         Unless otherwise specified, primaries that operate on files follow sym-
>         bolic links and operate on the target of the link, rather than the link
>         itself.
>
> Andreas.

I still personally find this overloading of the term "file" to refer to:

(1) a generic operand of those primaries we'll call "file", be it an 
actual file or something else

(2) an actual file

somewhat unnecessarily ambiguous compared to the POSIX version.

As a minor point, when I read the POSIX's wording of "resolves to an 
existing directory entry", I find it intuitive, possibly from 
familiarity with other Computer Science contexts like DNS in which 
look-ups happen in a chain, that the word "resolves" might entail 
recursion, as in the case I highlighted in code, where a link's target 
was another symlink. When I read "follow", especially paired with the 
singular "the target of the link" (not "of the links" or "of the link 
chain" or similia - and by the way, why use "link" here and not 
"symlink"? to give the name "link" to a "chain of symlinks"?), I am left 
wondering for a moment if that implies recursion or not, which is 
something I did not, subjectively, wonder about when reading the 
alternative word "resolves". After all, the man page for readlink uses 
the word "follow" to read a link's target but it makes the point of 
being explicit about recursive application for the canonicalisation 
options, as if it weren't automatic to think of "following a link" as 
"following it... until the end":

        -f, --canonicalize
               canonicalize by following every symlink in every 
component of the given name recursively; all but the last component must 
exist

        -e, --canonicalize-existing
               canonicalize by following every symlink in every 
component of the given name recursively, all components must exist

        -m, --canonicalize-missing
               canonicalize by following every symlink in every 
component of the given name recursively, without requirements on 
components existence

If following is meant to be understood as "always to the end of the 
symlink chain", it seems redundant to say to follow _every_ symlink and 
to do so _recursively_.

So, in summary:

- file still looks less precise than pathname to me

- (minor point) resolution seems like an elegant term to copy from POSIX 
to indicate the recursive process, whereby to "follow", especially 
paired with a singular noun (i.e. link), might be more confusing to some

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: -e test description in the GNU Bash 5.0 man page from 7 December 2018 Marco Ippolito <maroloccio@gmail.com> - 2019-10-21 12:00 +0200

csiph-web