Package: devscripts
Version: 2.10.59
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: checkbashisms

Hi,

I just noticed {x..z} was never added to the detections list.

E.g.
$ dash -c 'echo {0..9}'
{0..9}
$ bash -c 'echo {0..9}'
0 1 2 3 4 5 6 7 8 9
$ ksh -c 'echo {0..9}'
0 1 2 3 4 5 6 7 8 9
$ pdksh -c 'echo {0..9}'
{0..9}

... and so on.

Attached patch is a basic implementation.
A Google Code Search search didn't reveal any major false positive, so I think 
it's good (next archive-wide checkbashisms run should prove me right, or 
wrong).

Cheers,
-- 
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net
--- unpacked/usr/bin/checkbashisms	2009-09-11 05:50:40.000000000 -0500
+++ /usr/bin/checkbashisms	2009-12-11 22:35:27.000000000 -0600
@@ -472,6 +472,8 @@
 	qr'\s\|\&' =>                    q<pipelining is not POSIX>,
 	qr'[^\\\$]\{([^\s\\\}]*?,)+[^\\\}\s]*\}' =>
 	                               q<brace expansion>,
+	qr'\{\d+\.\.\d+\}' =>
+	                               q<brace expansion, should be $(seq a b)>,
 	qr'(?:^|\s+)\w+\[\d+\]=' =>      q<bash arrays, H[0]>,
 	$LEADIN . qr'read\s+(?:-[a-qs-zA-Z\d-]+)' => q<read with option other than -r>,
 	$LEADIN . qr'read\s*(?:-\w+\s*)*(?:\".*?\"|[\'].*?[\'])?\s*(?:;|$)'

Reply via email to