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

2010-08-06 Thread Marc Herbert
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. Then just exclude .bashrc from your coding style.

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

2010-08-05 Thread Marc Herbert
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.

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

2010-08-05 Thread Clark J. Wang
On Thu, Aug 5, 2010 at 4:06 PM, Marc Herbert marc.herb...@gmail.com 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

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

2010-08-05 Thread Chris F.A. Johnson
On Fri, 6 Aug 2010, Clark J. Wang wrote: On Thu, Aug 5, 2010 at 4:06 PM, Marc Herbert marc.herb...@gmail.com 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.

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

2010-08-05 Thread Clark J. Wang
On Fri, Aug 6, 2010 at 9:54 AM, Chris F.A. Johnson ch...@cfajohnson.comwrote: On Fri, 6 Aug 2010, Clark J. Wang wrote: On Thu, Aug 5, 2010 at 4:06 PM, Marc Herbert marc.herb...@gmail.com wrote: Le 04/08/2010 15:29, Clark J. Wang a écrit : I do not agree. Aliases are much simpler to use

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

2010-08-04 Thread Marc Herbert
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. Have a look at

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

2010-08-04 Thread Bernd Eggink
Am 04.08.2010 12:39, schrieb Clark J. Wang: I was testing the precedence between functions and aliases so I tried like this (with bash 4.1.5): $ cat rc alias foo='echo this is the alias' foo() { builtin echo 'this is the function' } foo $ source rc bash: confusing-aliases-2.sh: line 4:

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

2010-08-04 Thread 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

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

2010-08-04 Thread Bernd Eggink
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

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

2010-08-04 Thread Clark J. Wang
On Wed, Aug 4, 2010 at 7:03 PM, Marc Herbert marc.herb...@gmail.com 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

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

2010-08-04 Thread Bernd Eggink
Am 04.08.2010 16:38, schrieb Clark J. Wang: On Wed, Aug 4, 2010 at 8:27 PM, Bernd Egginkmono...@sudrala.de wrote: Am 04.08.2010 12:39, schrieb Clark J. Wang: I was testing the precedence between functions and aliases so I tried like this (with bash 4.1.5): $ cat rc alias foo='echo this

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

2010-08-04 Thread Chet Ramey
On 8/4/10 10:38 AM, Clark J. Wang wrote: Function definitions are not simple commands. Actually, func definition syntax is listed under the *Compound Commands* section in bash2.05b's man page and in bash3+ it's been moved to a separate section. While technically true, that doesn't enter into