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