Peter Memishian wrote:
>
> > - Nitpicking: Please use "function foo" functions, not Bourne-style
> > "foo()", e.g.
> > turn
> > -- snip --
> > +remove_eof_mobileip() {
> > + typeset -r mip_pkgs='SUNWmipr SUNWmipu'
> > + typeset pkg
> > -- snip --
> > into
> > -- snip --
> > +function remove_eof_mobileip {
> > + typeset -r mip_pkgs='SUNWmipr SUNWmipu'
> > + typeset pkg
>
> Except that everything else in bfu.sh uses the first syntax -- and
> consistency within the script should be paramount.
I woud agree but IMO it may be nice to not add old-style Bourne shell
function constructs - it'll only result in more cleanup work for me...
;-(
> Likewise for most
> of your other suggestions.
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/tools/scripts/bfu.sh
shows that [[ ]] and [ ] syntax (and "manual" use of the "test" builtin)
is both used in the script. Per David Korn (see
http://mail.opensolaris.org/pipermail/shell-discuss/2007-June/000993.html
- this was one of the postings used for the basis for the new shell
style guide) the [[ ]]-syntax should be preferred for ksh scripts (both
ksh88 and ksh93) - which IMO makes sense since [ ] will pass the
arguments through all the shell expansion machinery (which is very
expensive).
And IMO dangerous stuff like "rm" should really use quotes for arguments
with variables _everywhere_ - it's only an accident which is waiting to
happen (for example imagine that "rootprefix" contains the value "cannot
find /kernel/exec/sparcv9/elfexec in archive" (e.g. a variable holds an
error message (or similar stuff) by accident) - without quotes "rm" will
attempt to remove the files "cannot", "find",
"/kernel/exec/sparcv9/elfexec", "in" and "archive" (rebooting the system
after this point may result in interesting things... =:-) ). I'm not
sure whether "consistency" is a good idea in that case...
> The script must not look like a
> ransom note.
Uhm... what do you mean with "ransom note" ?
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) [EMAIL PROTECTED]
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 7950090
(;O/ \/ \O;)
_______________________________________________
networking-discuss mailing list
[email protected]