Hey again.
I just noted that bash and klibc sh behave differently from dash and
busybox sh...
$ cat circumflex-test
case "$1" in
(['^.a'])
echo match
;;
(*)
echo else
esac
$ cat exclamation-test
case "$1" in
(['!.a'])
echo match
;;
(*)
echo else
esac
$ cat run-circumflex
echo dash:
dash circumflex-test ^
dash circumflex-test .
dash circumflex-test a
echo busybox-sh:
busybox sh circumflex-test ^
busybox sh circumflex-test .
busybox sh circumflex-test a
echo bash:
bash circumflex-test ^
bash circumflex-test .
bash circumflex-test a
echo klibc-sh:
/usr/lib/klibc/bin/sh circumflex-test ^
/usr/lib/klibc/bin/sh circumflex-test .
/usr/lib/klibc/bin/sh circumflex-test a
$ cat run-exlamation
echo dash:
dash exclamation-test '!'
dash exclamation-test .
dash exclamation-test a
echo busybox-sh:
busybox sh exclamation-test '!'
busybox sh exclamation-test .
busybox sh exclamation-test a
echo bash:
bash exclamation-test '!'
bash exclamation-test .
bash exclamation-test a
echo klibc-sh:
/usr/lib/klibc/bin/sh exclamation-test '!'
/usr/lib/klibc/bin/sh exclamation-test .
/usr/lib/klibc/bin/sh exclamation-test a
When run:
$ sh run-circumflex | paste - - - - | column -t
dash: match else else
busybox-sh: match else else
bash: match match match
klibc-sh: match match match
$
^ . a
$ sh run-exlamation | paste - - - - | column -t
dash: match match match
busybox-sh: match match match
bash: match match match
klibc-sh: match match match
$
! . a
Does anyone have any explanation for this (other than it being a bug in
dash/busybox-sh[0])?
Thanks,
Chris.
[0] And yes I know this list is about bash, but since here are so
knowledgable experts I thought I could dare to ask. O:-)