Thread (56 messages) flat view 56 messages, 5 authors, 2016-06-15

Re: [PATCH/RFC v3 2/7] gettext: Add a Gettext interface for shell scripts

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:48:54

On Wed, Jun 2, 2010 at 06:32, Johannes Sixt [off-list ref] wrote:
[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:
quoted
+    # 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help