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: Greg Wooledge
Subject: Re: unset does not remove functions like a[b] unless -f is specified
Date: Thu, 2 Feb 2023 08:16:24 -0500

On Thu, Feb 02, 2023 at 04:47:34PM +1000, Martin D Kealey wrote:
> > ...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 $.  ...
> 
> I'm guessing the intention is that it shouldn't contain any expansions, so
> it also shouldn't contain `backticks` or <(command substitutions).
> 
> Hmm, I wonder whether <(:) could be a valid function name, if it expands to
> something like /dev/fd/63?
> 
> I agreed, it's better to make the documentation agree with how it actually
> behaves, rather than add more weirdness to the behaviour.

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".



reply via email to

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