bug-bash
[Top][All Lists]
Advanced

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

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


From: Clark J. Wang
Subject: Re: Issues when func name is the same with an alias
Date: Fri, 6 Aug 2010 11:31:24 +0800

On Fri, Aug 6, 2010 at 9:54 AM, Chris F.A. Johnson <address@hidden>wrote:

> On Fri, 6 Aug 2010, Clark J. Wang wrote:
>
>  On Thu, Aug 5, 2010 at 4:06 PM, Marc Herbert <address@hidden>
>> wrote:
>>
>>  Le 04/08/2010 15:29, Clark J. Wang a écrit :
>>>
>>>> I do not agree. Aliases are much simpler to use than functions.
>>>>
>>>
>>> Please provide examples.
>>>
>>> The following is a part of my aliases. I'll have to write much more code
>>> if
>>>
>> I define them all as functions.
>>
>
>    This is "much more code":
>
> F(){ find "$@"; }
>
> This simple func definition will be 4 lines in my coding style. :) And I
like adding at least one blank line between functions.


>    than:
>
> alias F=find
>
>
>  I don't think functions are better than aliases here. Any idea?
>>
>
>    Many reasons why functions are generally better have already been
>    given.
>
> I understand functions are *generally* better and there're quite a lot of
functions defined in my bashrc.  I just don't agree we have to avoid using
aliases.

>  --
>   Chris F.A. Johnson, <http://cfajohnson.com>
>   Author:
>   Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
>   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)


reply via email to

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