Re: [PATCH] Improve sed portability
- From
Jeff King <peff@peff.net>
- Date
- Jun 11, 2008, 16:39 UTC
- Message-ID
- <20080611163904.GB19172@sigill.intra.peff.net>
- In-Reply-To
- <484FEF71.2030909@isode.com>
On Wed, Jun 11, 2008 at 04:29:53PM +0100, Chris Ridd wrote:
Show 9 quoted lines
> It is necessary to use double quotes. This: > > printf '%s\n' foobar > > prints a literal \, a literal n, and no newline: > > foobar\n > > Not desirable :-(
On what platform?
Show 5 quoted lines
> Of course, using a plain old: > > echo "$1" > > should work well too. Why is printf being used here and not echo, anyway?
Because the original didn't have a newline, and "echo -n" isn't portable?
-Peff