Ralf Corsepius sent me this morning a detailed PR with about the same
behavior. I'm highly tempted to consider this a bash bug, unless
someone can demonstrate the usefulness of the following feature...
/tmp/build % cat /tmp/foo.sh nostromo 19:22
#! /bin/sh
case "/foo" in
[/\\]*) echo 1;;
esac
case "/foo" in
/* | \\*) echo 2;;
esac
case "/foo" in
[\\/]*) echo 3;;
esac
case "\foo" in
[/\\]*) echo 1;;
esac
case "\foo" in
/* | \\*) echo 2;;
esac
case "\foo" in
[\\/]*) echo 3;;
esac
/tmp/build % bash /tmp/foo.sh nostromo 19:24
2
3
1
2
3
/tmp/build % zsh /tmp/foo.sh nostromo 19:24
1
2
3
1
2
3
I suppose we should drop the use of [] here. Pfff.