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.