This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: [FYI] Possible bash bug.
- To: earnie_boyd at yahoo dot com
- Subject: Re: [FYI] Possible bash bug.
- From: Bob McGowan <rmcgowan at veritas dot com>
- Date: Mon, 27 Mar 2000 17:35:38 -0800
- CC: cygwin users <cygwin at sourceware dot cygnus dot com>
- Organization: VERITAS Software
- References: <20000327182429.29819.qmail@web111.yahoomail.com>
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
rmcgowan@veritas.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com