Hi Paul,
On 3/26/07, Paul Eggert <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] Shell Pattern Matching
[EMAIL PROTECTED] Shell Pattern Matching
[EMAIL PROTECTED] Shell pattern matching
+
+Nowadays portable patterns can use negated character classes like
[EMAIL PROTECTED] The older syntax @samp{[^-aeiou]} is supported by
+some shells but not others; hence portable scripts should never use
[EMAIL PROTECTED] as the first character of a bracket pattern.
+
+Outside the C locale, patterns like @samp{[a-z]} are problematic since
+they may match characters that are not lower-case letters.
The default locale is the C locale. Nevertheless, one shell (not ksh
or Solaris' sh)
thinks it is okay for [a-z] to match 'B' even when all locale
variables are undefined.
In other words, this:
unset LANG `env|sed -n 's/=.*//;/^LC_/p'`
ls [a-z]*
is insufficient. Thus:
+Outside the C locale, and even sometimes in the defaulted-to C locale,
+patterns like @samp{[a-z]} are problematic since
+they may match characters that are not lower-case letters.
+but the @code{(} in this example is not portable to many older Bourne
+shell implementations. It can be omitted safely.
Do we refer to the currently shipping Solaris 10 /bin/sh as an "older Bourne
shell implementation"? A few might find it non-obvious that an "older
implementation" is still actively shipped. :)
Cheers - Bruce
_______________________________________________
Autoconf mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/autoconf