Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Alias call in function fails...




> On Jun 23, 2020, at 7:04 AM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> 
> Andreas Kusalananda Kähäri wrote on Tue, 23 Jun 2020 13:28 +0200:
>> On Tue, Jun 23, 2020 at 11:55:20AM +0200, Mikael Magnusson wrote:
>>> On 6/23/20, Andreas Kusalananda Kähäri <andreas.kahari@xxxxxx> wrote:  
>>>> On Tue, Jun 23, 2020 at 01:23:55AM +0200, Mikael Magnusson wrote:  
>>>>> Aliases are expanded on parse time, which means aliases defined in a
>>>>> file won't be usable in that same file. (Because it is parsed in its
>>>>> entirety before any of the code is actually run).  
>>>> 
>>>> If the alias is defined before the definition of the function, it ought to
>>>> work.  
>>> 
>>> As I already explained, it will not.
>>> 
>> 
>> As Peter Stephenson explained, it depends.
>> 
> 
> See also the ALIAS_FUNC_DEF option.

My amateur 2 cents … I gave up on aliases with bash and never tried them with zsh.

Aliases are just weird oddities that have lots of special cases.  Since functions now exist (aliases came first in the global history of shells), I don’t see any advantages to aliases and they have many problems.

I don’t know of anything an alias can do that a function can’t?



Messages sorted by: Reverse Date, Date, Thread, Author