Subject: Re: discrepency beteen /bin/echo and builtin echo of /bin/sh
To: David Laight <firstname.lastname@example.org>
From: Greg A. Woods <email@example.com>
Date: 06/10/2002 00:40:21
[ On Sunday, June 9, 2002 at 20:11:09 (+0100), David Laight wrote: ]
> Subject: Re: discrepency beteen /bin/echo and builtin echo of /bin/sh
> The PROBLEM are those scripts that start #! /bin/sh and expect
> behaviour that isn't part of the traditional bourne shell.
Ah, WRONG! These days /bin/sh should be expected to be at least
POSIX.2 compliant, if not full SuSv2 compliant. Truly traditional
Bourne shell is truly unrealistic and very restrictive.
> (this include netbsd's build.sh)
> Systems that install shells into /bin/sh which are nothing
> like a bourne shell ought to be deleted (bash is a particularly
> good example of a bad sh).
Yes, "bash" specific requirements should be bashed out of existance.
> There is the slight unfortunate problem that the SuS requires
> that sh behave (to some extent) like ksh.
> (Posix probably allows you to do anything that any system that
> wanted to be called 'posix compiant' actually did at the time
> the standard was written - whether or not it was sensible.)
Perhaps you should do a real-world comparison between POSIX.2 and
SuSv2. They're really not all that far apart. Ksh was leading in
innovations, and for very good reasons.
> I do (usually) try to write scripts that that a 'proper'
> bourne sh (eg the solaris one) will run.
Well in that case (i.e. the solaris one), you're already lost.
If you were to use /usr/xpg4/bin/sh you'd be much better off.
Greg A. Woods
+1 416 218-0098; <firstname.lastname@example.org>; <email@example.com>; <firstname.lastname@example.org>
Planix, Inc. <email@example.com>; VE3TCP; Secrets of the Weird <firstname.lastname@example.org>