Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: alias not found
- X-seq: zsh-users 20860
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: alias not found
- Date: Thu, 29 Oct 2015 16:53:13 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern_com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=49gaCLA8kc+ZM5F02N0Vj0H6FaLXDjAi1EHnQMMaJu8=; b=yB3ElWYSviQARGGMBpNfeYJ4YhESmBPO8FYtHgebYt7LgxIEAcKV3+O+gqxfxGkTZz t1YLMohEmUMAw5AKUZ0XQJgbTSCV+t6VeSzblKNfYU/iseHq+e1NEKFI3lm+9iZ/pzU3 fgv+YbFifAbVPTEDkre/7EM+cLbJeO9y6oEQT4pb3sSeuW2GL8nnO6U83BLNPq6OB81h xcpSMuIU8AvFRJTxLswB5B0XWFzIqXjEo5vV0FmQmbEUrZAAhZGa7GvCNdQqXOrna5xP y7tQHLbmG88QA3XaCTl7SUSzQmyRK/FjNB3dfQjyCQ5/eE6TRbpeM9boNSz4fVMeq5pZ ReTQ==
- In-reply-to: <56328272.40709@eastlink.ca>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <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 "$@" }
Messages sorted by:
Reverse Date,
Date,
Thread,
Author