Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#480889: zcompiling messes with alias-in-function expansion
- X-seq: zsh-workers 25007
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx, 480889@xxxxxxxxxxxxxxx
- Subject: Re: Bug#480889: zcompiling messes with alias-in-function expansion
- Date: Mon, 12 May 2008 17:13:46 +0100
- In-reply-to: <20080512160400.GA10140@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080512145509.GA15757@xxxxxxxxxxxxxxxxx> <20080512160400.GA10140@xxxxxxxx>
Clint Adams wrote:
> I imagine that this is somehow related to
>
> alias foo='echo bar'; foo
Right, it's the same problem. Aliases are expanded early on, during
input, and so you can't use an alias within the same chunk of shell code
as where it's defined. This isn't going to change; you need to find a
workaround. The standard approach is to use functions in such chunks of
code. Aliases tend to be regarded as largely an interactive feature.
This ought to be documented somewhere, if it isn't.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author