[Xorp-cvs] XORP cvs commit: xorp/devnotes

Pavlin Radoslavov pavlin at ICSI.Berkeley.EDU
Tue Apr 29 12:07:04 PDT 2008


Pavlin Radoslavov <pavlin at ICSI.Berkeley.EDU> wrote:

> Kristian Larsson <kristian at spritelink.net> wrote:
> 
> > On Tue, Apr 29, 2008 at 01:53:44AM +0000, Pavlin Radoslavov wrote:
> > > CVSROOT:	/usr/local/www/data/cvs
> > > Module name:	xorp
> > > Changes by:	pavlin at chum.icir.org	2008-04-29 01:53:44 UTC
> > > 
> > > XORP CVS repository
> > > 
> > > 
> > > Modified files:
> > > 	devnotes      update_cvsroot.sh 
> > > 
> > > Log message:
> > > 	Replaced "echo -n" with "echo", because the former doesn't
> > > 	work as expected on MacOS X 10.2 with the following /bin/sh
> > > 	version:
> > > 	
> > > 	GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0)
> > > 	
> > > 	Interestingly, the corresponding /bin/bash is fine:
> > > 	
> > > 	user at host[3] sh
> > > 	sh-3.2$ echo -n FOO
> > > 	-n FOO                <------ WRONG
> > > 	sh-3.2$ exit
> > > 	
> > > 	user at host[4] bash
> > > 	bash-3.2$ echo -n FOO
> > > 	FOObash-3.2$          <------- OK
> > 
> > I don't have my MacBook in front of me right now,
> > but could this possible be bash builtin echo vs
> > /bin/echo or equivalent ?
> > 
> 
> Good point!
> 
> It looks like the builtin echo in /bin/sh is the one with the
> problem:
> 
> user at host[70] /bin/sh
> sh-3.2$ /bin/echo -n FOO
> FOOsh-3.2$ echo -n FOO
> -n FOO
> sh-3.2$ 
> 
> Though, according to the FreeBSD echo(1) manual page, printf(1)
> instead of "echo -n" should be used for maximum portability,
> so I am inclined to just use "echo" instead of "/bin/echo -n"
> or printf(1).

A clarification: after some testings it appears that in the
particular script the newline suppression is not important, hence
"echo" (no arguments) itself will do the job.

Pavlin

> Thanks,
> Pavlin
> 
> >    Kristian.
> > 
> > -- 
> > Kristian Larsson                                        KLL-RIPE
> > Network Engineer & Peering Coordinator      SpriteLink [AS39525]
> > +46 704 910401			              kll at spritelink.net
> > 
> > _______________________________________________
> > Xorp-cvs mailing list
> > Xorp-cvs at icir.org
> > http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-cvs
> 
> _______________________________________________
> Xorp-cvs mailing list
> Xorp-cvs at icir.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-cvs



More information about the Xorp-cvs mailing list