bug-bash
[Top][All Lists]
Advanced

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

Re: Having an alias and a function with the same name leads to some sort


From: Oğuz İsmail Uysal
Subject: Re: Having an alias and a function with the same name leads to some sort of recursion
Date: Sat, 18 Feb 2023 08:50:42 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1

On 2/18/23 2:05 AM, Chet Ramey wrote:
If the shell reads an unquoted word in the right position, it checks
the word to see if it matches an alias name. If it matches, the shell
replaces the word [in the input] with the alias value, and reads that
value as if it had been read [from the input] instead of the word.
This isn't what bash does. See:

    $ alias foo='cat <<EOF
    bar
    EOF
    '
    $ foo
    $ date
    $ uname
    $ ^C
    $ date
    Sat Feb 18 08:41:32 AM +03 2023
    $

Other shells I tested print `bar' and return to prompt. I remember reporting a bug like this before but not sure if it was the same.




reply via email to

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