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. 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. > line becomes: 'moretest""' is not recognized as an internal or external > command, operable program or batch file. > > (various experiments with cmd /c and cmd /k still won't let me see the > executed command, and give some error or another) > > :set shellxquote=( shellquote=\" > :.!echo "test|moretest" > shell returned 255 > E485: Can't read file C:\tmp\VIo2E3.tmp > > Line remains blank. > > Oh, here we go, with shellxquote=( and shellquote=\": > :.!cmd /c "echo "test|moretest"" > No errors, line becomes "test|moretest" as intended. > > Note with shellxquote unset, this still does not work. > > However, my original use case, trying to filter through Perl, does not > work if we need to run it through cmd /c first. It replaces the line with > a blank line instead. I'm pretty sure cmd /c doesn't take input on stdin > and thus can't act as an actual filter. Hm, perhaps you need to set the shelloptions to perl? > If there is a way to actually accomplish filtering through a program with > '|' as an argument on Windows gvim, I'd love to know. If there's not a way > to do so, I think there needs to be. 'shelltemp' probably should not > default to off, since according to :help 'shelltemp' that will prevent It isn't off by default in my Vim and the help clearly states this: ,---- | 'shelltemp' 'stmp' boolean (Vi default off, Vim default on) | global `---- regards, Christian -- 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
