help-bash
[Top][All Lists]
Advanced

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

Re: Exclusion of `${##}` from the doc of `${parameter#word}`?


From: Peng Yu
Subject: Re: Exclusion of `${##}` from the doc of `${parameter#word}`?
Date: Sun, 9 May 2021 10:43:01 -0500

On 5/9/21, Andreas Kusalananda Kähäri <andreas.kahari@abc.se> wrote:
> ${#parameter} is well defined in POSIX for the case when parameter is #.

I am not talking about POSIX manual. I am referring to the bash manual.

> The following expansions are explicitly unspecified in POSIX for the case
> when parameter is # (or @ or *).
>
>       ${parameter#[word]}
>       ${parameter##[word]}
>       ${parameter%[word]}
>       ${parameter%%[word]}
>
> I think it's correct that the bash shell uses the defined POSIX case
> before accepting its own extended syntax.  It would be rather awkward to
> get the length of $# otherwise.
>
> What is the issue you're trying to resolve in relation to this?

The bash manual is ambiguous in the case of ${##}. The manual should
have clearly stated that ${##} matches the `${#parameter}` paragraph
in the manual instead of the ${parameter#word} paragraph of the
manual. Otherwise, both paragraphs can be applied to ${##}, indicating
the ambiguity.

-- 
Regards,
Peng



reply via email to

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