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):
http://www.chiark.greenend.org.uk/~sgtatham/aliases.html

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

--
Bernd Eggink
http://sudrala.de

Reply via email to