Thanks, Chet! Yes, you're right that zsh definitely does not encourage use of these non-standard constructs. This whole thread got started when I accidentally created a mashup of shell/perl, similar to:
for (( i=0; i<3; ++i )) { echo $i; } and was really quite surprised to find that it worked, never having seen it mentioned in the documentation that I've perused so many times before.Then I went hunting for where it was documented, and here we are. So, I'm looking for a possible way to avoid my future self having to spend so much timehunting for what is causing me to misunderstand shell syntax so severely.I also now understand your desire to not propagate this alternative syntax intonew code. Maybe a comment in the documentation along the lines of: There are also alternate, deprecated syntactic constructs for these loops which will not be documented here would serve both aims? -- John On Monday, March 10, 2025 at 09:23:08 AM EDT, Chet Ramey <chet.ra...@case.edu> wrote: On 3/7/25 12:23 PM, John Wiersba wrote: > You're discouraging it's use by not documenting it. BTW, according to > those links below, apparently zsh documents it (and encourages its use)? I think "encourages" is a very generous reading of "These are non-standard and are likely not to be obvious even to seasoned shell programmers; they should not be used anywhere that portability of shell code is a concern." > Two questions: > > 1. Is there a link to some page where you document obsolete/discouraged/ > deprecated constructs? No. There are only a couple, so we achieve the outcome of not having them used in new code by making them difficult to find. > 2. Is our conversation being recorded somewhere in the gnu archives, so > that I can link to it in my stackoverflow question? Otherwise, I'll > just clip quotes from it to paste there. The thread starts here: https://lists.gnu.org/archive/html/bug-bash/2025-03/msg00009.html Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/