Re: Bug#291039: kernel-patch-debian-2.6.10: bashism in apply file
On Wed, Jan 19, 2005 at 04:15:26PM +0900, Horms wrote:
> On Tue, Jan 18, 2005 at 07:48:38PM +0900, Kenshi Muto wrote:
> > When I tried to build kernel 2.6.10 from debian source, I got
> > following message.
> >
> > /usr/src/kernel-patches/all/2.6.10/apply/debian 2.6.10-3
> > /usr/src/kernel-patches/all/2.6.10/apply/debian: 160: Syntax error: Missing '))'
> >
> > I'm using dash as sh. I think patch-code should use #!/bin/bash or
> > be fixed for plain bourne shell.
I agree that this may be a problem in dash. Anyway, there's a simple
workaround, the only problem is this line
for base in $((cd $home/series/ && ls -d *) | sort -rnt- -k 2); do
and to make it the parser easier, simply put a space between the two '(':
for base in $( (cd $home/series/ && ls -d *) | sort -rnt- -k 2); do
With some good will you can read this from:
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_03
---
If the command substitution consists of a single subshell, such as:
$( (command) )
a conforming application shall separate the "$(" and '(' into two tokens
(that is, separate them with white space). This is required to avoid any
ambiguities with arithmetic expansion.
---
Cc Herbert.
Regards, Gerrit.
Reply to: