From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Remi Vanicat <vanicat@debian.org>,
git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [BUGS] test failure in t4014-format-patch.sh with master
Date: Thu, 17 Apr 2008 18:03:27 +0200 [thread overview]
Message-ID: <20080417160327.GA13462@atjola.homenet> (raw)
In-Reply-To: <alpine.LFD.1.00.0804170841270.2879@woody.linux-foundation.org>
On 2008.04.17 08:44:07 -0700, Linus Torvalds wrote:
>
>
> On Thu, 17 Apr 2008, Björn Steinbrink wrote:
> >
> > Debian has its own dash which is supposed to be a lightweight
> > alternative to bash and "for checking POSIX compliance of scripts"
> > (quote from the packages description). I don't happen to know off-hand
> > whether POSIX says that echo should default to -e, but dash seems to do
> > that:
> >
> > $ dash
> > $ a="hello\nhi"
> > $ echo $a
> > hello
> > hi
>
> Ahh. So that "echo" should just be replaced with a 'printf "%s\n"'
> instead?
>
> We have a _lot_ of "echo"s though. I suspect the only ones we'd ever catch
> are the ones explicitly tested for. I suspect that the dash echo is just
> broken.
Wow, seems that "echo" in itself is "broken". According to POSIX[1]
backslashes induce implementation defined behaviour, and there seem to
be two historic versions of echo, one that knows about -n and one that
interprets escape sequences. So echo is totally non-portable unless you
avoid -n as well as backslashes. Ouch.
The POSIX docs, as well as random Google results, indeed recommend to
use printf instead. But that switch seems painful as well...
Björn
[1] http://www.opengroup.org/onlinepubs/009695399/utilities/echo.html
next prev parent reply other threads:[~2008-04-17 16:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-17 9:30 [BUGS] test failure in t4014-format-patch.sh with master Remi Vanicat
2008-04-17 15:11 ` Linus Torvalds
2008-04-17 15:34 ` Björn Steinbrink
2008-04-17 15:44 ` Linus Torvalds
2008-04-17 16:03 ` Björn Steinbrink [this message]
2008-04-17 16:24 ` Jeff King
2008-04-17 16:27 ` Jeff King
2008-04-17 15:44 ` Rémi Vanicat
2008-04-18 18:30 ` Junio C Hamano
2008-04-18 18:37 ` Linus Torvalds
2008-04-18 22:13 ` Rémi Vanicat
2008-04-19 6:51 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080417160327.GA13462@atjola.homenet \
--to=b.steinbrink@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=torvalds@linux-foundation.org \
--cc=vanicat@debian.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).