home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.bash.bug
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!twinsun.COM!junio
- From: junio@twinsun.COM (Jun Hamano)
- Subject: 'case' broken?
- Message-ID: <bk6K|#cx@twinsun.com>
- Sender: gnulists@ai.mit.edu
- Organization: Twin Sun, Inc. (El Segundo CA)
- Distribution: gnu
- Date: Sat, 26 Dec 1992 04:40:15 GMT
- Approved: bug-bash@prep.ai.mit.edu
- Lines: 37
-
- I found a small incompatibility between bash 1.12 and /bin/sh
- SunOS 4.1.2. I'm not sure if this is a bug, or `implementation
- defined' incompatibility.
-
- The following code shows that bash's `case' thinks a string
- `abcd' matches *<newline>* while /bin/sh does not.
-
- -- >8 --
- shadow 100) bash -c 'echo $BASH_VERSION'
- 1.12.1
- shadow 101) cat case.sh
- NL='
- '
-
- for i in "$@"
- do
- case $i in
- *$NL*) echo "case: $i: newline detected"
- esac
- done
- shadow 102) /bin/sh case.sh abcd 'ab
- > cd'
- case: ab
- cd: newline detected
- shadow 103) bash case.sh abcd 'ab
- > cd'
- case: abcd: newline detected
- case: ab
- cd: newline detected
- shadow 104)
- -- >8 --
- --
- |
- __-+-__ Jun Hamano
- _-+ (|o|) +-_ junio@twinsun.com
- ! . !
-
-