[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071102020118.GA13852@gondor.apana.org.au>
Date: Fri, 2 Nov 2007 10:01:18 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Randy Dunlap <rdunlap@...otime.net>
Cc: Andreas Mohr <andi@...as.de>, Andrew Morton <akpm@...l.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH/RFC] eradicate bashisms in scripts/patch-kernel
On Thu, Nov 01, 2007 at 04:08:57PM -0700, Randy Dunlap wrote:
>
> > - replace non-standard bash string parsing by sed expression
> > (is the sed syntax ok? correct? strict enough?)
>
> I think that this is the part that bothers me. I can't find
> anything at
> http://www.opengroup.org/onlinepubs/000095399/utilities/xcu_chap02.html
> that says that this:
> EXTRAVER=${EXTRAVER%%[[:punct:]]*}
>
> is invalid or even optional syntax. OTOH, it does list such syntax,
This is POSIX-compliant and has worked with dash from the very
start.
> > About the missing $ signs:
> > http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_14
> > says:
> > "If the shell variable x contains a value that forms a valid integer
> > constant, then the arithmetic expansions
> > "$((x))" and "$(($x))" shall return the same value."
> >
> > Hmm, well, seems dash doesn't... (syntax error).
> > Thus I still needed to add the $ signs despite opengroup.org specifying
> > it differently.
>
> Herbert?
Using variables without dollar signs in arithmetic expansion was
only added to dash very recently. So please please talk to your
distribution maker to update their dash packages and it will work
correctly.
This usage is compliant with the most recent revision of POSIX
while earlier ones did not specifically require this (due to
the fact that assignment support was not required either).
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists