On Wednesday, June 20, 2012 10:59:43 AM UTC-5, Christian Brabandt wrote:
> On Wed, June 20, 2012 17:21, Ben Fritz wrote:
> > gvim -N -u NONE -i NONE
> > :set shellxquote= shellquote=\" shelltemp
> > :.!echo "test|moretest"
> >
> > shell returned 255
> 
> 
> Yes, I am pretty sure:
> gvim -u NONE -I NONE -N
> :set shellquote=\" shellxquote= shelltemp verbose=4
> :.!echo "test|moretest"
> 
> Calling shell to execute: ""echo "test|moretest""
> <C:\DOCUME~1\de914854\LOCALS~1
> 
> 
> Shell returned 255.
> 
> 'moretest""' is not recognized as an internal or external command,
> operable program or batch file.
> 

Thanks for that, I didn't know about getting the command passed to the shell 
with 'verbose'.

That might be useful to mention in :help 'verbose' :-)

I note the command passed to the shell printed by the verbose setting doesn't 
seem to account for shellxquote or shellcmdflag or other such things.

> As you can see, in front of the | there is not filename put.
> Well, possibly the quoting is wrong, but it's not Vim's fault.
> Frankly, I really have lost track, which of the shell options need to
> be set (especially with the latest patches, that changed how the
> quoting works on Windows) and how quoting works on cmd.exe. When I
> used Vim on Windows more regularly, I used Cygwin bash as shell.
> 

After this input, I tried escaping the '|' for the sake of the cmd.exe shell. 
Either of the following work:

:set shellxquote= shellquote=\" shelltemp
:.!echo "test^|moretest"
:!echo "test^|moretest"
:echo system('echo "test|moretest"')
Note, the system() function is now inconsistent with filter or :! command, as 
it does not require escaping.

:set shellxquote=( shellquote= noshelltemp
:.!echo "test|moretest"
:!echo "test|moretest"
:echo system('echo "test|moretest"')
Note, with noshelltemp everything works consistently and as expected with the 
shellx?quote settings at their default values.

> 
> Hm, perhaps you need to set the shelloptions to perl?
> 

I'd rather not set the shell to Perl every time I want to run an external Perl 
command.

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui