delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/05/15/14:57:27

Date: Sat, 15 May 1999 14:57:26 -0400
Message-Id: <199905151857.OAA20668@delorie.com>
Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: Steve Morris <sjm AT judgement DOT com>
To: cygwin AT sourceware DOT cygnus DOT com
Subject: bug: cygwin/bash: echo > %ED does wrong thing

"echo >%ED" creates the wrong file. The %E gets expanded to "error 2".

Here are some experiments that bound the behavior:

experiment 1:

bash-2.02$ ls -l
total 0
bash-2.02$ echo > %ED
% ls -l
total 1
-rw-r--r--  1 0               Everyone   1 May 15 13:43 error 2D

experiment 2:

$bash-2.02$ mv "error 2D" %ED
$bash-2.02$ ls -l
total 1
-rw-r--r--  1 0               Everyone   1 May 15 13:43 %ED

experement 3:

$bash-2.02$ cmd
(C) Copyright 1985-1996 Microsoft corp
C:\sjm\tmp> echo >%ED
C:\sjm\tmp> exit
$bash-2.02$ ls -ltr
total 1
-rw-r--r--  1 0               Everyone   5 May 15 13:58 %ED
$bash-2.02$ 

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

Steve Morris



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019