cmd.exe and file name conversion from comman line argument
Fri Jul 27 09:15:00 GMT 2018
> From: Marco Atzeri <email@example.com>
> what happen if you use bash ?
With cmd + bash, the problem does not occur, but I would like to use cmd
without bash, if possible.
> From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
> To: firstname.lastname@example.org
> Date: 2018/07/27 14:25
> Subject: Re: cmd.exe and file name conversion from comman line argument
> Sent by: email@example.com
> Under a Unix shell, both double quote " and single quote/apostrophe '
> quoting metacharacters, as is backquote/grave `, but any character may
> in a file name by prefixing with the escape character \.
> Under Windows cmd only double quote " is a quoting metacharacter; path
> delimiters : \ /, wild card characters * ?, and redirection
> characters | < > are
> also not allowed in file names. So to create a Windows file name with a
> from cmd, use only double quotes " around the name.
Thank you. quoting only the space character worked, which seems to solve
from cmd, with LANG environment variables set to ja_JP.UTF-8
c:\cygwin\home\hiroo> touch ãã" "ã
c:\cygwin\home\hiroo> touch ãã' 'ã
gives a file named ãã ã.
The rest may be superfluous, but just to compare with.
Quoting Japanese characters too did not work.
c:\cygwin\home\hiroo> touch "ããã"
(and shown as ã»ãããã» in explorer)
c:\cygwin\home\hiroo> touch "aaa"
c:\cygwin\home\hiroo> echo > "ããã"
(in this case, the file name is surely processed by cmd)
gives a file named ããã (without quotes).
> Under Cygwin, any file name characters disallowed by Windows are mapped
> Unicode private use area characters, but converted back on display, so
> Windows programs those files' long names will display characters without
> assigned glyphs.
> Note that in ls, nongraphic characters in a file name entry e.g. space,
> that file name entry to be displayed single quoted 'a b'; specifying ls
> -N|--literal|--quoting-style=literal omits the single quotes, but
> characters are displayed on terminals as question marks ?, unless
> --show-control-chars is also specified.
> Run "info ls 'Formatting the file names'" to see full explanations.
> Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
More information about the Cygwin