bug-bash
[Top][All Lists]
Advanced

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

Re: bash 4.4 changed behavior wrt to builtin 'command'


From: Greg Wooledge
Subject: Re: bash 4.4 changed behavior wrt to builtin 'command'
Date: Mon, 7 Aug 2017 11:47:58 -0400
User-agent: NeoMutt/20170113 (1.7.2)

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

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