[Bash-completion-devel] vncviewer

Mike Kelly pioto at pioto.org
Tue Mar 3 14:12:12 UTC 2009


On Tue, 3 Mar 2009 09:36:38 +0100
Freddy Vulto <fvulto at gmail.com> wrote:

> On Mon, Mar 2, 2009 at 9:55 PM, Guillaume Rousse
> <Guillaume.Rousse at inria.fr> wrote:
> >>   $ readlink -f "$(which vncviewer)"
> > /usr/bin/vncviewer
> 
> Hmm, I believe `which' is Debian specific.  Perhaps `type' works.
> What does this output on your machine:
> 
>    $ readlink -f "$(type -p vncviewer)"

Actually, which is available on every UNIX system I've ever used...

What you actually want is "$(type -P vncviewer)". Otherwise, if they
have set alias vncviewer='vncviewer -foo' somewhere, type -p returns
nothing, while type -P will return the expected results.

Also, readlink -f isn't portable -- it doesn't work on FreeBSD, at
least. On FreeBSD, you need to use realpath instead.

-- 
Mike Kelly



More information about the Bash-completion-devel mailing list