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 19:50:11 -0500

On Fri, Feb 03, 2023 at 06:38:36AM +0700, Robert Elz wrote:
> which is harmless, unless the shell is badly breaking the command
> execution rules of POSIX (zsh does I believe) but because for any
> shell that follows those rules, it is impossible to invoke a function
> with a '/' in its name.

unicorn:~$ function /bin/echo { date; }
unicorn:~$ /bin/echo hello
Thu Feb  2 19:37:14 EST 2023

> The rules for executing commands require that any command name with a
> '/' in it simply be handed to exec*() as is - it can never be a built
> in command, can never be a function, and never searches PATH.

Then bash is also in violation.

I haven't read all of the rest of your message yet (skimmed it), but I'll
also point out that so far I have not been able to export a function
named /bin/echo through the environment and into a bash script.  I'm not
sure whether it's possible -- but the failure could simply be due to a
lack of creativity on my part.



reply via email to

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