Bug#374185: mkvmlinuz: syntax errors in script
On Wed, Jul 12, 2006 at 10:42:38PM +0200, Bastian Blank wrote:
> reopen 374185 unreproducible
> severity 374185 important
> thanks
>
> On Wed, Jul 12, 2006 at 09:50:53AM +0100, Colin Watson wrote:
> > This part of the report is still valid no matter whether you're using
> > dash or bash. In bash, I get:
> >
> > /usr/sbin/mkvmlinuz: 61: arith: syntax error: "OPTIND-1"
>
> | $ cat test.sh
> | shift $((OPTIND-1))
> | $ bash -x test.sh
> | + shift 0
Oh, I do apologise, it turned out that my /bin/sh was dash after all so
I got confused. Using non-$-prefixed variables inside arithmetic
expansion was a bit of shell syntax [1] that I wasn't aware of.
Sven: it was "OPTIND" => "$OPTIND" I was talking about, not the added
spaces.
It doesn't seem unreasonable to change mkvmlinuz to work around this
dash bug (linked to by Gerrit) for now, though. Personally (and I
suppose it's a matter of taste) I find it clearer to $-prefix variables
even inside arithmetic expansions.
[1] http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_04
Cheers,
--
Colin Watson [cjwatson@debian.org]
Reply to: