On Mon, 2008-02-04 at 16:06 -0800, Russ Allbery wrote: > "Adam D. Barratt" <[EMAIL PROTECTED]> writes: > > > The first two certainly should be prefixed by something to avoid them > > matching strings that happen to end in "echo -e". I've updated > > checkbashisms to do so for all three. > > > > As far as I can see that won't stop "echo echo -e" matching, however. > > I was proposing using: > > '(?:^|\s+)echo\s+-e', # echo -e > '(?:^|\s+)exec\s+-[acl]', # exec -c/-l/-a name > '(?:^|\s+)let\s', # let ...
That's what I've changed checkbashsims to use. Unless I'm missing something (which I'm more than happy to have pointed out :) "echo echo -e" matches "\s+echo\s+-e" as the expression isn't (in that case) anchored to the start of the line. Specifically: [EMAIL PROTECTED]:~/debian/packages/devscripts/svn/trunk$ cat echo.sh #!/bin/sh echo echo -e [EMAIL PROTECTED]:~/debian/packages/devscripts/svn/trunk$ scripts/checkbashisms.pl echo.sh possible bashism in echo.sh line 3 (echo -e): echo echo -e Adam -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]