zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk, 480889@bugs.debian.org
Subject: Re: Bug#480889: zcompiling messes with alias-in-function expansion
Date: Mon, 12 May 2008 17:13:46 +0100	[thread overview]
Message-ID: <200805121613.m4CGDlhx031983@news01.csr.com> (raw)
In-Reply-To: <20080512160400.GA10140@scru.org>

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@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


      reply	other threads:[~2008-05-12 16:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080512145509.GA15757@lapse.madduck.net>
2008-05-12 16:04 ` Clint Adams
2008-05-12 16:13   ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200805121613.m4CGDlhx031983@news01.csr.com \
    --to=pws@csr.com \
    --cc=480889@bugs.debian.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).