[Top][All Lists]

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

Re: Issues when func name is the same with an alias

From: Bernd Eggink
Subject: Re: Issues when func name is the same with an alias
Date: Wed, 04 Aug 2010 15:58:11 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv: Gecko/20100713 Thunderbird/3.1.1

Am 04.08.2010 15:13, schrieb Eric Blake:
On 08/04/2010 05:03 AM, Marc Herbert wrote:
Le 04/08/2010 11:39, Clark J. Wang a écrit :

Seems like I must explicitly use the `function' keyword to define foo() for
this scenario. Is that the correct behavior?

The correct behaviour is simply not to use aliases, since they bring nothing
to the table compared to functions.

Not _quite_ true - there are a few things aliases can do that functions
cannot, and when combined, you can get some cool interactive effects
(although I don't recommend relying on this in scripts):

Interesting article. One thing not mentioned there is declarations.

    alias assoc='declare -A '
    assoc x y z

Not particularly useful, but you can't replace that with a function (as long as there is no 'global' option for declare).


Bernd Eggink

reply via email to

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