[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH] latest ash has broken 'echo' command



Perhaps I'm jumping in prematurely, but I'd like to cast
my vote _strongly_ against the default `/bin/echo' not
accepting -n.  

It breaks many programs which are assembling binary files
from shell scripts.  It breaks a million install programs.
It breaks a million build environments.  It will make a million
programs display unnecessary ugly output.  Don't say "use automake"
unless you are willing to translate programs I give to you
to use it.  B/c I compile a lot of poorly written software--
do we have to break things so as to make this harder?

Of course, I don't care what ash's builtin does, only the external
program has real bearing on me.

FYI:

Here are two times I've used echo -n that would lead to subtle
bugs:
	- one program to measure disk speed created files that were
	  exactly a megabyte by
	  	echo -n aaaaaaaaaa > a
		cat a a a a a a a a a a > b
		cat b b b b b b b b b b > a
		cat a a a a a a a a a a > b
		cat b b b b b b b b b b > a
		cat a a a a a a a a a a > b

	- one program used `echo -n' to inject a second target
	  to a makefile generated by gcc's -MD options.

These uses could be eliminated-- but I don't want to.  The code works
currently, though and I never use it.

Looks like this little contribution to global bitrot called SUS will
take its vengeance on this innocent software.

- Dave

On Fri, 22 Oct 1999, Herbert Xu wrote:

> On Thu, Oct 21, 1999 at 09:39:00PM +0200, Sven Rudolph wrote:
> > 
> > Did we decide to follow Single Unix Specification. I thought we were
> > on POSIX, and my draft allows -n (implementation defined).
> 
> If it's implementation defined that means echo is also allowed to not support
> any options at all.  So if you were going to write a script that should work
> on all POSIX compliant shells, you must not use options and escape codes.
> 
> > According to rationale this compromise fulfills BSD and SYSV
> > tradition.
> 
> I understand that.
> 
> > The Single Unix Specification explicitely forbids BSD heritage while
> > it standardises the SYSV way.
> 
> Not really, unless POSIX enforces the options and escape codes, there is
> no way to use them portably.  So printf is still the way to go for escape
> codes and -n.
> 
> PS Can someone please find the exact phrasing of POSIX on this matter?
> -- 
> Debian GNU/Linux 2.1 is out! ( http://www.debian.org/ )
> Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 
> 


Reply to: