From 3ff6b64bbe3fd48a61bb0371cfbe44e6f610fb10 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 6 May 2025 09:57:56 +0200 Subject: [PATCH] doc: Document another pitfall of shell pattern matching. * doc/autoconf.texi (Shell Pattern Matching): Mention non-portability of patterns with braces. --- doc/autoconf.texi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 7b156b820..129e80181 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -16280,6 +16280,17 @@ some shells but not others; hence portable scripts should never use Outside the C locale, patterns like @samp{[a-z]} are problematic since they may match characters that are not lower-case letters. +Patterns with braces are, although not specified by POSIX, supported +by most shells. Not so by AIX 7.3 @command{/bin/sh}, though: + +@example +$ @kbd{ls -1 sequence000.c sequence999.c} +sequence000.c +sequence999.c +$ @kbd{ls -1 sequence@{000,999@}.c} +ls: 0653-341 The file sequence@{000,999@}.c does not exist. +@end example + @node Shell Substitutions @section Shell Substitutions @cindex Shell substitutions -- 2.47.3