[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH] Avoid using non-portable =?utf-8?b?YGVjaG8=?= =?utf-8?b?LW5g?= in tests.
From:       Steve Folly <steve () spfweb ! co ! uk>
Date:       2008-10-31 9:36:03
Message-ID: loom.20081031T093317-846 () post ! gmane ! org
[Download RAW message or body]

Junio C Hamano <gitster <at> pobox.com> writes:

> 
> Brian Gernhardt <benji <at> silverinsanity.com> writes:
> 
> > 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.
> 
> I had an impression that OS X was BSDish.  Wasn't "echo -n" a BSDism?
> 

FYI, "man echo" on OS X 10.5.5 has this to say...

     The following option is available:

     -n    Do not print the trailing newline character.  This may also be
           achieved by appending `\c' to the end of the string, as is done by
           iBCS2 compatible systems.  Note that this option as well as the
           effect of `\c' are implementation-defined in IEEE Std 1003.1-2001
           (``POSIX.1'') as amended by Cor. 1-2002.  Applications aiming for
           maximum portability are strongly encouraged to use printf(1) to
           suppress the newline character.

     Some shells may provide a builtin echo command which is similar or iden-
     tical to this utility.  Most notably, the builtin echo in sh(1) does not
     accept the -n option.  Consult the builtin(1) manual page.


Regards,
Steve.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic