[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#253012: Bug#253498: non-posixisms



On Wed, Jun 09, 2004 at 04:11:39PM -0400, Clint Adams wrote:
> These RE's could be tweaked, I imagine, but they're better than the current
> situation.
> 
> --- /usr/share/lintian/checks/scripts	2004-04-25 17:53:59.000000000 -0400
> +++ checks/scripts	2004-06-09 15:59:57.703351772 -0400
> @@ -422,7 +422,15 @@
>  		  '[^\\\]\{([^\s]+?,)+[^\\\}\s]+\}',     # brace expansion
>  		  '(?:^|\s+)\w+\[\d+\]=',      # bash arrays, H[0]
>  		  '\$\{\#?\w+\[[0-9\*\@]+\]\}',   # bash arrays, ${name[0|*|@]}
> -		  '(?:^|\s+)(read\s*(?:;|$))'  # read without variable
> +		  '(?:^|\s+)(read\s*(?:;|$))', # read without variable
> +		  '(test|\[) .+-[ao]',	       # test/[ -a/-o binary operators

(test|\[).+\s-[ao]\s perhaps?

This has still the problem of mathing stuff in " " but we can probably
ignore that.

> +		  'kill\s+-[^s]',	       # kill -[0-9] or -[A-Z]

I would suggest either kill\s+-[^sl] or kill\s+-[0-9A-Z]

> +		  'trap\s+".*"\s+.*[1-9]',     # trap with signal numbers

hmm, perhaps better trap\s+["']?.*["']?\s+[1-9]

> +		  'local',		       # local scoping of variables

local\s

> +		  'command\s+-v',	       # UPism
> +		  'type .+',		       # XSIism

type\s+.+ just to be consitent

> +		  'echo\s+-[neE]',	       # technically -n is permitted
> +		  '&>'			       # technically a cshism
>  		);
>  
>  		for my $re (@bashism_regexs) {

And we need an common RE before the commands to try to guess if they are
really commands.

Will look further into it, thanks for the patch.

Gruesse,
-- 
Frank Lichtenheld <djpig@debian.org>
www: http://www.djpig.de/



Reply to: