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

Re: /bin/sh as an alternative



On Fri, Jan 16, 1998 at 10:40:43AM +1100, Hamish Moffatt wrote:
> On Fri, Jan 16, 1998 at 12:08:47AM +0100, Remco Blaakmeer wrote:
> > Yes, I can only agree. But is bash actually completely POSIX-compliant
> > (and nothing more than that) when called as /bin/sh ?
> 
> It would appear not:
> 
> sh-2.01$ echo hello {there,world}
> hello there world

In fact even being called as "sh --posix" it does this. I'm fairly sure that
there is an option to turn brace expansion off though.

However is this being non-POSIX or merely an extension ontop of POSIX?  I
_like_ brace expansion and would be a bit miffed (to say the least) if it
got turned off by default.  A quick check shows that ksh also does brace
expansion, but (pd)ksh doesn't. 

The original policy was more "your scripts shouldn't use non-POSIX features
if they are run using /bin/sh" than anything else.

I can't check with the original post, but personally I think that if a
script *does* use bash features then in addition to beginning "#!/bin/bash"
it should Depend: on bash. Eventually we could just have a POSIX compliant
shell in /bin and stop requiring bash (obviously this is a long term goal).

Adrian

email: adrian.bridgett@poboxes.com       | Debian Linux - www.debian.org
http://www.poboxes.com/adrian.bridgett   | Because bloated, unstable 
PGP key available on public key servers  | operating systems are from MS


Reply to: