On Fri, Mar 19, 2021 at 09:12:34AM +0100, Alex fxmbsw7 Ratchev wrote:
> eval $'alias n=bla\nn() { type $FUNCNAME ; }\nn'
> bla is a function
> bla ()
> {
>     type $FUNCNAME
> }
> 
> it was supposed to be n() ..

The eval $'...' can be left out.


$ echo $BASH_VERSION
5.0.17(1)-release
$ alias n=bla
$ n() { type $FUNCNAME; }
$ declare -pf n
bash: declare: n: not found
$ declare -pf bla 
bla ()
{
        type $FUNCNAME
}

It is the same on 5.1.4(1)-release.

I would have expected that n was a defined function.
But I would not have bet on it.

Regards, Mike Jonkmans

Reply via email to