From: Jeff King Date: Sat, 26 May 2007 06:27:48 GMT Subject: Re: Bug: git-rebase goofs up \n in commit messages Message-ID: <20070526062748.GA21229@coredump.intra.peff.net> In-Reply-To: <20070526061942.GA5986@gondor.apana.org.au> On Sat, May 26, 2007 at 04:19:42PM +1000, Herbert Xu wrote: > > Is "\n" portable to all shells (i.e., do you need '\n')? It works with > > bash and dash, which are by far the most common, but who knows what evil > > lurks in the heart of Sun? > > You mean the "\n" in printf? Yes that is specified in POSIX. > Without the "\n" printf will act like echo -n (which incidentally > is forbidden by POSIX). No, I meant would the shell, while interpolating a double-quoted string "\n", always preserve the string and pass the backslash and 'n' to printf? Clearly \\ and \" get interpolated, but I don't know the rules for "unrecognized" backslash sequences. -Peff