On Feb 22, 1:50 am, nanashi <[email protected]> wrote:
> :!start command is not working with /b option,
> when cscope is used.
>
>
> :!start /min cmd /c echo 1vim_free | cscope -dl -f cscope.out |
> C:\cygwin-1.7\bin\sed --regexp-extended -e "s/(\S+) (\S+) ([0-9]+)/\1:\3 \2
> ^I/" > ./test.txt
> /min option is working.
>
> but,
> :!start /b cmd /c echo 1vim_free | cscope -dl -f cscope.out |
> C:\cygwin-1.7\bin\sed --regexp-extended -e "s/(\S+) (\S+) ([0-9]+)/\1:\3 \2
> ^I/" > ./test.txt
> is not working normally.

I don't know if it's too late, but I wouldn't expect this to work,
based on our previous discussions on cmd.exe quoting.

What you're actually doing here, is:

run cmd /c echo 1vimfree
pipe the result of that whole cmd /c command to cscope
pipe the result to sed
redirect the whole output to test.txt

What you intend is:

run echo | cscope | sed > test.txt all in a cmd /c shell

There are a couple problems here. First of all, you should have quoted
the arg to cmd /c, or escaped the | characters with ^ yourself. True,
Vim can probably fix this (I see a couple later patches which claim
to, but I don't have time to test until maybe later this week or this
weekend). But should it? Does this somehow break some other use-case?
What about using & instead of |?

Second, I'm not sure why it would ever work with /b. :help :!start
says:

   2) You can use the /b flag to run console applications without
creating a
      console window for them (GUI applications are not affected). But
you
      should use this flag only if the application you run doesn't
require any
      input.  Otherwise it will get an EOF error because its input
stream
      (stdin) would be redirected to \\.\NUL (stdout and stderr too).

I've always taken the "stdout and stderr too" bit to mean that I
cannot redirect output to a file if I use /b. Is this not the case?
Have I just been interpreting it wrong even since /b was introduced?
Or maybe this restriction was just something that needed some code to
overcome?

One reason 
http://vim.wikia.com/wiki/Execute_external_programs_asynchronously_under_Windows
uses /min instead of /b for the extended "async grep" example is to
allow the redirection to work. Does it work with /b if we properly
escape things, potentially using the latest patch?

-- 
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