zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: alias not found
Date: Thu, 29 Oct 2015 16:53:13 -0700	[thread overview]
Message-ID: <151029165313.ZM18037@torch.brasslantern.com> (raw)
In-Reply-To: <56328272.40709@eastlink.ca>

On Oct 29,  1:32pm, Ray Andrews wrote:
}
}     $ . ./navtools; type naliases; naliases
}     naliases is an alias for n_aliases
}     zsh: command not found: naliases

The entire line ". ./navtools; type naliases; naliases" has already
been parsed into bytecode before any of it is executed.  So when
navtools creates the alias, it's too late -- naliases has already
been consumed and is not subject to alias replacement until another
subsqeuent chunk of input is presented to the parser (effectively,
not until after the next PS1 prompt is printed).

This is one reason aliases are a bad idea in general.  It would be
much better if navtools used e.g.

    function naliases { n_aliases "$@" }


  reply	other threads:[~2015-10-29 23:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 20:32 Ray Andrews
2015-10-29 23:53 ` Bart Schaefer [this message]
2015-10-30  3:16   ` Ray Andrews
2015-10-30  4:56     ` Bart Schaefer
2015-10-30  6:00       ` Ray Andrews

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=151029165313.ZM18037@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /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).