home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / bash / bug / 715 < prev    next >
Encoding:
Text File  |  1993-01-01  |  1.4 KB  |  47 lines

  1. Newsgroups: gnu.bash.bug
  2. Path: sparky!uunet!think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cherniak.on.CA!quenton
  3. From: quenton@cherniak.on.CA (Dennis Smith)
  4. Subject: Bug (difference?) in case handling
  5. Message-ID: <1992Dec31.141125.13922@Cherniak.ON.CA>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: Cherniak Giblon
  8. Distribution: gnu
  9. Date: Thu, 31 Dec 1992 04:11:25 GMT
  10. Approved: bug-bash@prep.ai.mit.edu
  11. Lines: 34
  12.  
  13. I am running bash 1.12 and I have found a "difference" in case
  14. handling.  Here is the example:
  15.  
  16.     case xxx in
  17.       *"?"*) echo ERROR;;
  18.     esac
  19.  
  20. This example will echo "ERROR".  I suspect that the the resulting
  21. string within bash after parsing is  *?*  and the quotes are
  22. forgotten.  The quotes (according to /bin/sh) should escape the ? and
  23. make it a simple character.  The 'case' above is looking for the
  24. character "?" in the string "xxx".
  25.  
  26. If I double escape it:
  27.  
  28.     case xxx in
  29.       *"\?"*) echo ERROR;;
  30.     esac
  31.  
  32. then it does NOT match, but then neither does:
  33.  
  34.     case "xxx?xxx" in
  35.       *"\?"*) echo ERROR;;
  36.     esac
  37.  
  38. which still does NOT echo ERROR.
  39.  
  40. Given this last example, it appears impossible to look for "?" in a string.
  41. Thus I consider this a bug.  I would prefer it worked like /bin/sh.
  42. -- 
  43. Dennis Smith, quenton@Cherniak.ON.CA, UUCP: ..!lsuc!cherniak!quenton
  44. +1 416 771 7011, FAX +1 416 771 6288
  45. Cherniak Giblon 10 Commerce Valley Dr. E. #400, Thornhill, Ont. CANADA L3T 7N7
  46.  
  47.