bug-bash
[Top][All Lists]
Advanced

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

Re: Bug: please document extended and alternate for loop syntax


From: Zachary Santer
Subject: Re: Bug: please document extended and alternate for loop syntax
Date: Mon, 10 Mar 2025 12:38:25 -0400

On Mon, Mar 10, 2025 at 10:54 AM John Wiersba via Bug reports for the
GNU Bourne Again SHell <bug-bash@gnu.org> wrote:
>
> 2) However, if the alternate syntax is actively supported, then I think it 
> *should* be documented, even if it is considered error-prone and if 
> "best-practice" is to avoid it.
> The alternative is to have people, like me, stumbling on this undocumented 
> syntax and spending a considerable amount of time trying to explore what it 
> is and why it is undocumented.
> I *do* understand your concern to avoid expending maintainer effort in the 
> direction of something that you'd rather just go away.  I'm trying to see if 
> there is a reasonable middle ground between the two concerns.

Another alternative would be for bash to print a warning whenever it
encounters this syntax.

There are other weird, undocumented things that you could have the
same conversation about. ${#@} is equivalent to ${#}, and $[ ... ] is
another $(( ... )). As it is, this stuff doesn't really do any harm,
being there, besides raising the occasional question.

On the other hand, if there's ever reason to repurpose $[ ... ] in the
future, for example, the occasional ancient script that might still
expect that to perform arithmetic expansion could've been printing a
warning for years before that change came along.



reply via email to

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