Subject: Re: [FYI] Possible bash bug.
From: Bob McGowan <[email-masked]>
To: [email-masked]
Cc: cygwin users <[email-masked]>
Date: Mon, 27 Mar 2000 17:35:38 -0800

Earnie Boyd wrote:
> 
> This isn't Cygwin specific; but covers all cases of bash.
> 
> mkdir /foo
> case "/foo" in [/\\]*) echo 1;; esac
> case "/foo" in [\\/]*) echo 2;; esac
> 
> The first test case fails to find the directory /foo.
> The second test case finds /foo and echos 2.

There is no doubt that this is a bug, since in 'ksh' both scenarios
generate output.

But I have a concern regarding the above.  It appears to imply that a
directory named "/foo" must exist and that the case statement is somehow
"finding" this directory.  This is not my understanding about how the
case statement works, in any of bash, ksh or sh.

Granted, the pattern uses the standard shell wildcard patterns (file
globbing, and not regular expressions as used by grep and others), but
the match is made against the value "/foo" and not against file names. 
Both of the above will work (correctly or incorrectly, as the case may
be ;-)), when run in a completely empty directory.

-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
[email-masked]

--
Want to unsubscribe from this list?
Send a message to [email-masked]