bug-bash
[Top][All Lists]
Advanced

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

Re: unset does not remove functions like a[b] unless -f is specified


From: Dale R. Worley
Subject: Re: unset does not remove functions like a[b] unless -f is specified
Date: Thu, 02 Feb 2023 15:02:41 -0500

Greg Wooledge <greg@wooledge.org> writes:
> I'd be totally OK with restricting the function namespace a bit more.
> Function names should not be allowed to contain backticks or less-than
> or greater-than signs (in my opinion).  I'm still undecided about
> parentheses, but I'm leaning toward "denied".

I'd be perfectly fine if function names had to be "names", and my memory
is that old versions of Bash enforced that.  But the manual page hints
that was changed, and probably for a reason.  So proceed with caution.

              When  in  posix  mode,
              fname must be a valid shell name and may not be the name of one
              of the POSIX special builtins.  In  default  mode,  a  function
              name  can  be  any unquoted shell word that does not contain $.

Dale



reply via email to

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