[PATCH 3/4] hal-info: Clean up keymap-check.sh

Victor Lowther victor.lowther at gmail.com
Tue Mar 25 05:19:27 PDT 2008


On Tue, 2008-03-25 at 10:07 +0200, Daniel Stone wrote:
> On Mon, Mar 24, 2008 at 08:08:21PM -0700, ext Victor Lowther wrote:
> > -	sed -ne '/<append key="input.keymap.data"/ { # only keymap data lines
> > +	sed -ne '/^[[:blank:]]*<append key="input.keymap.data"/ { # data lines
> 
> Pretty sure [[:blank:]] is a GNUism.

[[:blank:]] is defined in SuS:
http://opengroup.org/onlinepubs/007908799/xbd/re.html#tag_007_003

> 
> > -		isin $data && echo "$data "
> > +		grep -q "^${data}\$" /tmp/quirk-keymap-list.txt || echo "$data "
> 
> Pretty sure extended mode without invoking egrep is a GNUism.

^ and $ basic regular expression characters. SuS again:
http://opengroup.org/onlinepubs/007908799/xbd/re.html#tag_007_003

> > -		if [ ! -z "$ret" ]; then
> > +		if [ "$ret" ]; then
> 
> This is a bashism, use -n instead or ! [ -z "$ret" ].

No, this behaviour is defined in SuS:
http://opengroup.org/onlinepubs/007908799/xcu/test.html

None of these are bashisms.  I do not test with bash.

> Cheers,
> Daniel
-- 
Victor Lowther
Ubuntu Certified Professional



More information about the hal mailing list