Re: [PATCH] Avoid using non-portable `echo -n` in tests.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 31, 2008 at 06:24:56PM +0000, Jeff King wrote:
> On Fri, Oct 31, 2008 at 01:09:13AM -0400, Brian Gernhardt wrote:
> 
> > Not all /bin/sh have a builtin echo that recognizes -n.  Using printf
> > is far more portable.
> > 
> > Discovered on OS X 10.5.5 in t4030-diff-textconv.sh and changed in all
> > the test scripts.
> 
> Hmph. I think this is a good patch, and there is precedent in the past
> (20fa04ea, 2aad957, 9754563). But I am surprised this was not caught by
> our recent autobuilding project.

Set up a Debian autobuilder with dash as a /bin/sh (apt-get install
dash, dpkg-reconfigure -plow dash and say 'yes'). You'll see those kind
of problems arise immediately.

Dash is a POSIX compatible shell, with almost no extension added (in
particular its echo has no -n option) which helps to find those kind of
issues.

It would help detecting git shell scripts that use bashism as well.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@xxxxxxxxxx
OOO                                                http://www.madism.org

Attachment: pgpWH7Pm3jMuD.pgp
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux