public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* cmd.exe and file name conversion from comman line argument
@ 2018-07-27  5:24 h_ono
  2018-07-27  6:56 ` Marco Atzeri
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: h_ono @ 2018-07-27  5:24 UTC (permalink / raw)
  To: cygwin

Hello,

There is strange behavior when naming a file from command line argument in 
cmd.exe cosole,
using touch or mv.

I use:
touch (GNU coreutils) 8.26
Packaged by Cygwin (8.26-2)

cygwin1.dll version 2.10.0

in cmd.exe, doing

> touch aaa
and
> touch 'aaa'

give same file name aaa.

> ls
 aaa

but, when I use Japanese characters as file name, it gives different file 
names
with and without the quote.

> env LANG=ja_JP.UTF-8 touch あああ

gives

> env LANG=ja_JP.UTF-8 ls
  あああ

but,

> env LANG=ja_JP.UTF-8 touch 'あああ'

gives file name with quote not stripped.

> env LANG=ja_JP.UTF-8 ls
  'あああ'

If called from mintty + bash,

$ env LANG=ja_JP.UTF-8 touch 'あああ'

gives

$ env LANG=ja_JP.UTF-8 ls
  あああ

The problem is when I create a file containing spaces in its name.
Creating a file in cmd.exe like:

> env LANG=ja_JP.UTF-8 touch 'ああ あ'

gives

> env LANG=ja_JP.UTF-8 ls
"'ああ あ'"

(which is a file named 'ああ あ', not ああ あ)
It seems, there is no way to create a file containing a space in its name, 
like
 ああ あ
with commands such as touch or mv.

Is it a normal behavior, or a bug?
Is there any way to create a file containing Japanese characters and 
spaces in its name
without quote added?

FYI, With old cygwin (cygwin1.dll version 1.5.25), there were not such 
problem.
Even from cmd.exe,

> touch 'ああ あ'

gave a file named 'ああ あ' (without the quote in real.)
----------
Hiroo Ono

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-07-30  1:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27  5:24 cmd.exe and file name conversion from comman line argument h_ono
2018-07-27  6:56 ` Marco Atzeri
2018-07-27  7:27 ` Andrey Repin
2018-07-27  8:08 ` Brian Inglis
2018-07-27  9:15   ` h_ono
2018-07-27 10:16     ` h_ono
2018-07-27 15:16     ` Takashi Yano
2018-07-30 10:54       ` h_ono

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).