Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [[ -x =command ]]



Matthew Wozniski <godlygeek@xxxxxxxxx>:
> On Wed, Oct 17, 2007 at 03:17:58PM +0200, Richard Hartmann wrote:
> > whence is a built-in, so unless I am missing something, it should be the
> > most portable solution.
> 
> Yes, but built in to what?  zsh has whence, but it certainly isn't in
> bash or sh.  The most portable solution I can see is
> command which most >/dev/null && { PAGER=most; export PAGER; }
> which works for me in busybox's ash shell, as well as bash and dash.

This will break for old things like opensolaris' /bin/sh.
If you leave the 'command' bit out, it'll work:

    which most >/dev/null && { PAGER=most; export PAGER; }

Yeah, an alias or a function called 'which' would break that. But it's
more portable than the 'command' approach.

However, since this is a zsh list, most people probably don't care.
And they shouldn't. :-)

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925



Messages sorted by: Reverse Date, Date, Thread, Author