Re: [PATCH/RFC v3 2/7] gettext: Add a Gettext interface for shell scripts
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jun 2, 2010, 08:53 UTC
- Message-ID
- <AANLkTim-z6JYmyvl5QWycPV9orsUu8qLg2ZVFP6ZeVLC@mail.gmail.com>
- In-Reply-To
- <4C05FAEF.2040205@viscovery.net>
On Wed, Jun 2, 2010 at 06:32, Johannes Sixt <j.sixt@viscovery.net> wrote:
Show 11 quoted lines
> [When you resend the series in such a manner that you collect a Cc list > manually, please do *not* include me. I'm not interested in this series.] > > Am 6/2/2010 1:39, schrieb Ævar Arnfjörð Bjarmason: >> + # Not everyone has echo -n >> + case $(echo -n) in >> + \-n) Xn= ; Xc='\c' ;; >> + *) Xn=-n ; Xc= >> + esac > > Don't use 'echo'; use 'printf %s'.
I didn't write this code (as the comment says) but I /thought/ that the whole point of it was to autodetect if echo -n worked, and if so use it because it'd be faster than printf "%s", otherwise use some evil foo\n\c hack.
That hack doesn't work on bash ('\c' produces a space), maybe it doesn't work anywhere. Do you have a shell that doesn't support echo -n? What does it output there?
I wouldn't be surprised if it did need to be changed to printf "%s". I'm just curious where it broke and how.