Tony Nguyen wrote:
> Casper.Dik at Sun.COM wrote:
> >> You're making a very typical engineering decision-making mistake IMHO.
> >> The mistake?  Turning every small issue into a big issue and then
> >> reaching the (flawed) conclusion that you can't solve the big issue
> >> for various reasons (possibly including insufficient resources).
> >>
> >> It's not an all-or-nothing problem. It's a small issue and the
> >> proposed solution is well worth the time/effort.
> >>
> >
> > Indeed; and apparently the ship has sailed, some method scripts
> > are already ksh or ksh93:
> >
> >    1 ELF binary
> >    1 ksh -p
> >    3 ksh93
> >    7 ksh
> >  108 sh
> >
> > There's no reason to make all scripts use the same shell.
> >
> > SMF is much better than /etc/init.d; init.d is forced through /sbin/sh;
> > SMF gives you the freedom to use whatever the kernel can execute.
> 
> I wasn't clear. The suggested ipf_include file is dotted by several
> other methods. Not all method scripts but only those that use
> ipf_include need to run the same shell as ipf_include. IFAIK,
> OpenSolaris delivers only ksh93 and renames sh to ksh, thus ksh93 is the
> only choice.

Right. And using ksh93 would help a lot to boost startup time. We
already know that even simple restructuring and use of ksh93 features
can boost complex scripts by a factor of 40 or more (usually by avoiding
|fork()|+|exec()|, copying large amounts of data through pipes or
unneccesary use (such as using "sed" repeatedly to fetch one word out of
a string with 40 characters) of filters like "sed"/"awk").

> My point was I'm not sure if it's reasonable to mandate scripts that
> uses ipf_method, delivered by other teams, to be ksh93 which may have
> incompatibilities such as scoping.

1. For scripts written for the original Bourne shell and using the POSIX
function syntax there are no differences in scoping and therefore no
incompatiblities. The most common issue is ksh88 vs. ksh93 where ksh93
changed the scoping behavour for functions defined with "foo() { ... ;
}" to conform to the POSIX standard (which isn't a great deal since you
can change this to "function foo { ... ; }"-style functions, something
David Korn and several books about the Korn and bash shells strongly
recommend).

2. I would recommend to _mandate_ at least ([1]) the use of POSIX shell
syntax and features for SMF script "includes" this is the most common
set for Bourne-compatible shells. If we just try to be compatible to the
old Bourne shell at "all cost" (something which has be critizied a lot
recently) then this will cause more long-term trouble than it's worth.

[1]=Which doesn't exclude the use of ksh93 features, but in such a case
the matching "script include" should contain a comment that ksh93 is a
requirement
----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

Reply via email to