Monday, March 29, 2010

Re: Path/executable() Bug

On Mar 29, 11:42 am, Paul <google01...@rainslide.net> wrote:
> On Mon, Mar 29, 2010 at 02:19:19AM -0700, Yakov wrote:
> >Make sure PATH does not contain a literal tilde, but rather,
> >is expansion, the value of $HOME.
>
> Yeah, looks like I'll have to do that, but...
>
> >Shell won't find executable in such PATH, too.
>
> ...when my $PATH is either of the two, I can run xsel just fine from anywhere, from the bash command line, despite...
>
> >It tilde appears in PATH, your PATH is wrong.

Ok I didn't know some shells do it (interpret literal ~ in PATH), but
other shells don't.
This turns out to be shell-dependent thing:

Shell Interprets literal~ in PATH ?
------- -----------------
bash yes
tcsh no
csh no
ksh no
zsh no
dash no (posix-compatible shell)
ash no (another posix-compatibl shell)
------- -----------------

If you insist on having literal ~ in your $PATH,
then adding this line to ~/.vimrc
will fix results of executable():

let $PATH=substitute($PATH,'\~',$HOME,'g')

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

No comments: