Hi Bdale,

On Thursday 13 May 2010 00:09:01 Bdale Garbee wrote:
> On Wed, 12 May 2010 22:47:17 -0500, Raphael Geissert <atom...@gmail.com> 
wrote:
> > checkbashisms' output:
> > > possible bashism in rules line 20 (unsafe echo with backslash):
> > >   echo "#!/bin/sh\njava -jar /usr/share/java/`/bin/ls build/jar`" > \
> 
> This looks like a false positive from your script?  I just checked, and
> this line appears to work exactly as expected in dash.  If there's
> really a problem here, I'll need help understanding what it is.
> 

The problem is that dash and other shells expand escape sequences by default 
on the 'echo' built-in while bash and others don't. The solution is printf.

Hope that explains it.

This should work no matter whether bash or dash is used as /bin/sh:
printf '#!/bin/sh\njava -jar /usr/share/java/%s\n' "`/bin/ls build/jar`" > \

Cheers,
-- 
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to