Otto Moerbeek wrote:
> > case "foobar" in
> > *[5-~]*) echo "Why do I match now?" ;;
> > esac
> >
> > What is going on here?
>
> You specify the range 5 ... ~, which includes all letters. See ascii(5).
Ah, silly me, it's a range! OK, this brings me to the real problem: This
comes from a recent version of configure in emacs which tries to test
for dirs with non-ascii characters:
temp_srcdir=`cd "$srcdir"; pwd`
for var in "`pwd`" "$temp_srcdir" "$prefix" "$exec_prefix" \
"$datarootdir" "$bindir" "$datadir" "$sharedstatedir" "$libexecdir"; do
case "$var" in
*[^\ -~]*) as_fn_error $? "Emacs cannot be built or installed in a
directory whose name contains non-ASCII characters: $var" "$LINENO" 5 ;;
esac
done
Which can be reduced to:
#!/bin/sh
case "foobar" in
*[^\ -~]*) echo "Why do I match now?" ;;
esac
Which seems like a valid test for the range of ascii characters. But it
fails with ksh and not with bash and zsh:
~% sh ./test.sh
Why do I match now?
~% zsh ./test.sh
~% bash ./test.sh
What's going on here?
# Han