Subject: Re: /bin/sh fixes to make printf a builtin and 'fix' echo
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@NetBSD.ORG>
From: Greg A. Woods <firstname.lastname@example.org>
Date: 06/14/2002 13:31:56
[ On Wednesday, June 12, 2002 at 11:47:23 (+0100), Ben Harris wrote: ]
> Subject: Re: /bin/sh fixes to make printf a builtin and 'fix' echo
> > Still looks like at least two variants are required though!
> Only if you believe that -e is still required.
You still don't need two variants to support '-e'. As I've shown by
example already it can safely be treated as '-n' and only interpreted as
an option flag if it appears as the first command-line parameter. I've
never seen it used with '-n' -- it is, after all, presumably an
alternative to '-n' (since with '-e' "echo" will presumably support
'\c'). However '-e' as an option flag should be a no-op in any
pragmatic implementation since '\' escapes should always be enabled.
> My opinion is that anyone
> using -e is depending on undocumented, non-standard behaviour, and deserves
> very little sympathy if it stops working.
The point is to make porting scripts painless, not to stick like
superglue to some single ivory-tower committee's view of how things
_should_ be in their view.
Greg A. Woods
+1 416 218-0098; <email@example.com>; <firstname.lastname@example.org>; <email@example.com>
Planix, Inc. <firstname.lastname@example.org>; VE3TCP; Secrets of the Weird <email@example.com>