retitle 497489 please detect the usage of [^] instead of [!]
thanks

Just noticed that my example was probably not very clear, so here's another 
example that I hope is easier to understand.

$ file="$(mktemp)"
$ cat > $file << FOO
#!/bin/sh

# This script expects [^] NOT to match, IOW: bash's behaviour

case "\$1" in
    [^m]oo)
        echo not moo
        exit
    ;;
esac

echo got moo
FOO
$ for sh in {po,{d,b}a,{m,pd,}k,z,busybox\ }sh; do echo "$sh: $($sh $file 
foo)"; done
posh: got moo
dash: got moo
bash: not moo
mksh: got moo
pdksh: got moo
ksh: not moo
zsh: not moo
busybox sh: not moo

And

$ for sh in {po,{d,b}a,{m,pd,}k,z,busybox\ }sh; do echo "$sh: $($sh $file 
moo)"; done
posh: not moo
dash: not moo
bash: got moo
mksh: not moo
pdksh: not moo
ksh: got moo
zsh: got moo
busybox sh: got moo

Cheers,
-- 
Raphael Geissert - Debian Maintainer
www.debian.org - get.debian.net

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to