bug: cygwin/bash: echo > %ED does wrong thing
Sat May 15 11:57:00 GMT 1999
"echo >%ED" creates the wrong file. The %E gets expanded to "error 2".
Here are some experiments that bound the behavior:
bash-2.02$ ls -l
bash-2.02$ echo > %ED
% ls -l
-rw-r--r-- 1 0 Everyone 1 May 15 13:43 error 2D
$bash-2.02$ mv "error 2D" %ED
$bash-2.02$ ls -l
-rw-r--r-- 1 0 Everyone 1 May 15 13:43 %ED
(C) Copyright 1985-1996 Microsoft corp
C:\sjm\tmp> echo >%ED
$bash-2.02$ ls -ltr
-rw-r--r-- 1 0 Everyone 5 May 15 13:58 %ED
I have tracked this down (see example C program in my earlier post) to
the open function call. With a little investigation I have discovered
that % in the open filename arguement can have other strange
behaviors. %% in a file name causes open to get an error. I can't find any
combination that creates a file with with a % in the name so I can't
figure out how to code a workaround.
Notice that the file can be created other ways, i.e. by renaming the
file. Also cmd.com doesn't have such unexpected behavior.
What exactly in the open command is doing this? I assume this is in
cygwin somewhere. For the life of me I can't think of which package
might want to use % as a quote character.
cygwin 20.1, NT 4
Want to unsubscribe from this list?
Send a message to email@example.com
More information about the Cygwin