[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: Blair Zajac <blair_at_orcaware.com>
Date: 2002-02-12 00:48:50 CET

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...
> > > SUCCESS
> > > -n Running all tests in random-test...
> > > SUCCESS
> > > -n Running all tests in hashdump-test...
> > > SUCCESS
> >
> > Hmmmm.
> >
> > 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.

Using sh's builtin echo you do echo 'some text\c'. Using /usr/bin/echo you can
use the -n.

I don't think it's a good idea to hardware the path to /bin/echo. Does
every OS have echo here? I wouldn't want to see what's going to break in
that case.

Several other solutions are:

1) Have a echo wrapper that figures this out for us.
2) Use the printf executable. Does every OS have this?

Best,
Blair

-- 
Blair Zajac <blair@orcaware.com>
Web and OS performance plots - http://www.orcaware.com/orca/
---------------------------------------------------------------------
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.