home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.bash.bug
- Path: sparky!uunet!think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cherniak.on.CA!quenton
- From: quenton@cherniak.on.CA (Dennis Smith)
- Subject: Bug (difference?) in case handling
- Message-ID: <1992Dec31.141125.13922@Cherniak.ON.CA>
- Sender: gnulists@ai.mit.edu
- Organization: Cherniak Giblon
- Distribution: gnu
- Date: Thu, 31 Dec 1992 04:11:25 GMT
- Approved: bug-bash@prep.ai.mit.edu
- Lines: 34
-
- I am running bash 1.12 and I have found a "difference" in case
- handling. Here is the example:
-
- case xxx in
- *"?"*) echo ERROR;;
- esac
-
- This example will echo "ERROR". I suspect that the the resulting
- string within bash after parsing is *?* and the quotes are
- forgotten. The quotes (according to /bin/sh) should escape the ? and
- make it a simple character. The 'case' above is looking for the
- character "?" in the string "xxx".
-
- If I double escape it:
-
- case xxx in
- *"\?"*) echo ERROR;;
- esac
-
- then it does NOT match, but then neither does:
-
- case "xxx?xxx" in
- *"\?"*) echo ERROR;;
- esac
-
- which still does NOT echo ERROR.
-
- Given this last example, it appears impossible to look for "?" in a string.
- Thus I consider this a bug. I would prefer it worked like /bin/sh.
- --
- Dennis Smith, quenton@Cherniak.ON.CA, UUCP: ..!lsuc!cherniak!quenton
- +1 416 771 7011, FAX +1 416 771 6288
- Cherniak Giblon 10 Commerce Valley Dr. E. #400, Thornhill, Ont. CANADA L3T 7N7
-
-