Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [[ -x =command ]]
- X-seq: zsh-users 12026
- From: "Richard Hartmann" <richih.mailinglist@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: [[ -x =command ]]
- Date: Wed, 17 Oct 2007 13:55:16 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=jnk1xdCu1ZZz41idD5JTdn4J08o/Iolp5OP4NKXUnJs=; b=gC4iU180e9i0lHzimtAYbVt3NBZNKeRNI9QqAKTbUFqxA8qM3IkcDJAGAtU/XOq4Ne3AOGGsbqqQ1E944vClzMXJdPA1SbUVa5/3LwdW9x9eIYPHeGV3uMitpoUEM2Wcr4VWZXj1t+q4CDhBxzxYPZIea6CvFbDsexwSqZpMoW8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=QRXBixsUN8oJY+e4/uuNsvlz09M+ShJHLeXPzvcQe4ssCeA5iq/dxLCNjFyvWvaEB2F5xCEgvINlu1fNLYm1vZsE6uYtP+z0JSHWid6RvCwtuEutYUjS7ie8Z15Aql3eCjKcYslXUTz3JFLEzFHLyGl5riihjm6Yzmm8CEy6H7Q=
- In-reply-to: <20071017113432.GA13054@mastermind>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20071016210548.26560.qmail@xxxxxxxxxxx> <20071016211319.GA2910@xxxxxxxxxxxxxxx> <20071016214100.62242.qmail@xxxxxxxxxxx> <20071017094414.GA5383@xxxxxxxxxxxxxxx> <20071017113432.GA13054@mastermind>
On 17/10/2007, Matthew Wozniski <godlygeek@xxxxxxxxx> wrote:
> mastermind% echo $commands[ls]
> /bin/ls
> mastermind% command -v ls
> alias ls='ls --color=auto -B'
>
> So, just for the sake of argument, if one were to have aliased `most'
> to `less' on a machine that didn't have most, the first form would
> work properly, but the second would result in a false positive and
> fail when an application tried to use $PAGER, since no alias expansion
> would be performed.
The canonical way to do this according to 'From Bash to Z Shell' (hi Peter)
is to use whence -p foo. Apparently, whence is what zsh uses internally,
anyway. If you are concerned about cluttering your $PAGER,
basename $(whence ls) is an option.
Richard
Messages sorted by:
Reverse Date,
Date,
Thread,
Author