On Mon, Aug 07, 2017 at 05:32:21PM +0300, Reto wrote:
> It does not work anymore in bash 4.4:
> 
>     # /bin/sh --version
>     GNU bash, version 4.4.12(1)-release (x86_64-redhat-linux-gnu)
>     Copyright (C) 2016 Free Software Foundation, Inc.
>     License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> 
>     This is free software; you are free to change and redistribute it.
>     There is NO WARRANTY, to the extent permitted by law.
>     # /bin/sh -c 'command(){ echo FOO;}; command'
>     /bin/sh: `command': is a special builtin
>     #
> 
> AFIK 'command' is no built in command in bourne shell,
> so I think it could be expected that if bash is called with /bin/sh
> 'command' can be used as function name?

I can't reproduce this on Debian 9:

wooledg:~$ (exec -a /bin/sh bash)
sh-4.4$ command() { echo hi; }
sh-4.4$ command
hi
sh-4.4$ echo "$BASH_VERSION"
4.4.12(1)-release

Reply via email to