Date:        Wed, 11 Jun 2025 10:07:37 -0400
    From:        Chet Ramey <chet.ra...@case.edu>
    Message-ID:  <7ef0aaf1-e56e-433e-9d29-4ad232871...@case.edu>

  | That's the function name. In general, a function name is a WORD that
  | does not undergo any word expansions, not even quote removal.

Not doing expansions I understand, though there's no general reason they
shouldn't be done there, but quote removal I'd suggest is essential,
otherwise there's no way to get white space into the function name,
without also embedding quoting characters in it.

Of all the chars that one might want to allow in function names, I'd
put white space near the top, and quoting chars down near the bottom
(though of course, quoted quotes would work, just as they do in command
invocation).

So, I'd strongly suggest doing (at least) quote removal on the word which
is to be the function name, so it matches the syntax for command invocation
-- other than other expansions, which is why the NetBSD sh currently also
prohibits unquoted or double quoted $ and ` in function names - as at
invocation time they'd be expanded, but at definition time they aren't - at
least currently).

kre



Reply via email to