Subject: [PATCH 4/5] checkbashisms: avoid a false positive output redirection match

From: Raphael Geissert <[email-masked]>
Date: Thu, 27 May 2010 14:11:35 -0500

Autoconf-generated configure files store a fd number in an argument
variable ($0..9) matching the check's pattern. Since this kind of uses
is rare enough outside autoconf, it is safe to skip it in such cases.

Signed-off-by: Raphael Geissert <[email-masked]>
---
 scripts/checkbashisms.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/checkbashisms.pl b/scripts/checkbashisms.pl
index f3f4ff4..dc79045 100755
--- a/scripts/checkbashisms.pl
+++ b/scripts/checkbashisms.pl
@@ -507,7 +507,7 @@ sub init_hashes {
 	qr'(?<![\$\(])\(\(.*\)\)' =>     q<'((' should be '$(('>,
 	qr'(?:^|\s+)(\[|test)\s+-a' =>            q<test with unary -a (should be -e)>,
 	qr'\&>' =>	               q<should be \>word 2\>&1>,
-	qr'(<\&|>\&)\s*((-|\d+)[^\s;|)}`&\\\\]|[^-\d\s]+)' =>
+	qr'(<\&|>\&)\s*((-|\d+)[^\s;|)}`&\\\\]|[^-\d\s]+(?<!\$)(?!\d))' =>
 				       q<should be \>word 2\>&1>,
 	$LEADIN . qr'kill\s+-[^sl]\w*' => q<kill -[0-9] or -[A-Z]>,
 	$LEADIN . qr'trap\s+["\']?.*["\']?\s+.*[1-9]' => q<trap with signal numbers>,
-- 
1.7.1