A.J.Mechelynck wrote:
Bram Moolenaar wrote:
Alexey I. Froloff wrote:
P.S. In UNIX string is surrounded by single quotes and all single
quotes in string replaced with quote-backslash-quote-quote.  On
DOS/WIN it surrounds string with double quotes and replaces
doublequotes and percents to space.

Makes sense for Unix.  I don't know about MS-DOS/WIN, may depend on the
$SHELL used.  Perhaps 'shellslash' may also need to be considered.

IIRC, in Windows percent signs should be doubled (which requires the same
kind of fancy-footwork as Vim's \ or ^V in the case of recursion), except
in the names of environment %STRINGS% to be resolved by the shell.
(Dos/Windows uses %NAME% where Unix uses $NAME or ${NAME}). I'm not sure
about how to quote double quotes.

Note: quotes (") in file names are of course illegal. However, if you're trying to embed quotes in arguments, "...\"..." appears to be the correct syntax (from 'cmd' anyway). Note that \" is treated literally ('\' followed by the start of a quoted string) unless already enclosed in quotes. Otherwise '\' is not treated specially (AFAICS anyway from cursory testing) as it is the path separator, not even in e.g. '\\"'.

If I use c:\cygwin\bin\echo.exe, I can get '"foo""bar"' to give me 'foo"bar', but ls only seems to like '"foo\"bar"' (which also works with echo). IOW, '\"' also works and seems more reliable. Both only work if surrounded by quotes.

HTH

--
Matthew
vIMprove your life! Now on version 7!

Reply via email to