Am 15.02.2012 14:38, schrieb RoDo:
You can execute
cmd /c ("my editor.exe" "my filea.txt" a ^& dir) as well.
Surprise -- it indeed executes `dir'.
This suggests that special characters within `(' ... `)' should be
escaped with `^'.
The following works as well:
cmd /c (^"my editor.exe^" ^"my filea.txt^" a ^& dir)
I found that `"(' ... `)"' still doesn't work for redirection:
cmd /c "(cat cm.txt > "c&m.txt")"
it tries to execute `m.txt")"'.
Doesn't work either for `('...`)':
cmd /c (cat cm.txt > "c&m.txt")
it creates `c&m.txt)'.
But `('...`)' works when inner special chars are escaped:
cmd /c (cat cm.txt ^> ^"c^&m.txt^")
cmd /c (echo a ^& echo b)
cmd /c (^"my editor.exe^" ^"my filea.txt^")
Special characters according to
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx
are
& < > ( ) @ ^ |
This list might not be complete, the website says "for example".
If we find a& inside "" like "&", don't touch it.
Otherwise, we automatic add ^ before& or wrap entire command with
"()".
Right?
No, we escape all special chars.
New settings:
shellcmdflag: /c
shellxquote: (
and escape special chars with `^'.
--
Andy
--
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