bug-bash
[Top][All Lists]
Advanced

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

Re: 5.3: Why is <(cmd) allowed in func names of func defs?


From: Robert Elz
Subject: Re: 5.3: Why is <(cmd) allowed in func names of func defs?
Date: Fri, 13 Jun 2025 01:03:39 +0700

    Date:        Thu, 12 Jun 2025 12:26:17 -0400
    From:        Chet Ramey <chet.ramey@case.edu>
    Message-ID:  <86c23b56-de98-431d-be83-727013b65b63@case.edu>

  | This isn't unreasonable, at least for the change to allow quoted characters
  | in function names.

If that also includes any characters which would need to be quoted
to be included in a word (doesn't have to include chars which would
be magic when the word is expanded, just the ones which normally
affect tokenisation - operators, white space, and the quoting chars)
then that will allow a future change to proceed without difficulties.

But the one which introduced this topic (seeming process substitutions,
except not, as function names) should not be allowed (unless quoted,
so the '<' '(' ')' wouldn't be magic, and so not until quoted words
are permitted, with quote removal being performed).

That is read a word, just like the word that follows a << redirect,
and then if you want, check if there's any quoting in it, and refuse
that (or just do quote removal and allow it).   Anything not quoted
which forms a word is good (as would be any quoted word if quote
removal happens).  A check to disallow '/', quoted or not, is a nice extra.

kre




reply via email to

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