From: Keith M. <kei...@to...> - 2007-04-27 13:44:52
|
Julien Lecomte wrote, quoting me: >> $ cmd //c echo "C:/Documents and Settings/keith/My Documents" >> "dir C;D:\MSYS-1.0.11\Documents and Settings\keith\My Documents" >> >> ... >> >> $ cmd //c echo "dir C:/Documents and Settings/keith/My Documents" >> "dir C;D:\MSYS-1.0.11\Documents and Settings\keith\My Documents" > > > The builtin 'echo' of cmd.exe and bash behave differently: > *cmd.exe:* > > > echo "Hello World" > "Hello World" > > > echo Hello World > Hello World > > *bash:* > > $ echo "Hello World" > Hello World > > $ echo Hello World > Hello World > > So in your first and last case; if you unquote the 'echo' passed to > cmd; then you should get: > > $ cmd //c echo C:/Documents and Settings/Lecomte/Mes documents > C:/Documents and Settings/Lecomte/Mes documents > > $ cmd //c echo dir C:/Documents and Settings/Lecomte/Mes documents > dir C:/Documents and Settings/Lecomte/Mes documents But the purpose of the example was to illustrate how MSYS incorrectly translates a string, with an embedded Win32 path name, prefixed by some other text, when it hands it off to a native program, (cmd.exe in this case). This is a known edge case, where MSYS is simply too clever for its own good: when it finds a string with text preceding the `C:/' it assumes that it represents a POSIX style `PATH=/colon/separated:/path', and converts it to the equivalent semicolon separated form. There seems to be no reliable way to avoid that, when it is not wanted. By removing the quotes, you destroy the intent of the example. Regards, Keith. |