[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] echo -n is not portable and used too much

From: Kirby C. Bohling <kbohling_at_birddog.com>
Date: 2002-02-12 00:34:38 CET

Okay, I am an evil, evil person, but this is one of the few extremely
portable ways I know of dealing with newlines. It should work on lots
of UNIX machines, but probably not on windows unless they are cygwin
scripts is:

echo "foobar" | tr '\012' '\000'

It works fine under Linux, and I know tr is the magic command we used to
use on Solaris to do DOS->UNIX file conversion. It is also an extremely
relable way to generate control sequences to standard out and not have
them interpreted by the shell.

echo "foobar" | tr '\012' '\000' && echo "This is a test "

foobarThis is a test

Which is what I am assuming you want. If you can't find any other way,
you might try this. I wouldn't start here unless you're a gluton for



Ben Collins wrote:
> On Mon, Feb 11, 2002 at 05:20:49PM -0600, Karl Fogel wrote:
>>Blair Zajac <blair@orcaware.com> writes:
>>>On Solaris, running make check results in output like this:
>>>make check
>>>-n Running all tests in path-test...
>>>-n Running all tests in random-test...
>>>-n Running all tests in hashdump-test...
>>What would be the normal way to get the same effect on Solaris?
>>(Or is there a way?)
> I can't recall if Solaris shell uses a built-in or not, but try changing
> echo to /bin/echo. Might even have to use the ucb echo.

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:06 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.