David Korn wrote:
> 
> Subject: Re: [shell-discuss] shellstyle
> --------
> 
> I have a couple of corrections and a suggestion for the shellstyle draft.
> 
> Use ksh-style function.
>         You have 'note that that "integer" is an alias for "typeset -il"'
>         when it is actually an alias for "typeset -li".   Thus,
>         integer 8 x=value can be used for octal integers.

Fixed.

> Use autoload to load common functions, not source.
>         A better suggestion would be to put functions in a directory and
>         put the directory in both FPATH and in PATH.

Erm, half "fixed" ... I've listed FPATH for now until I've figured out
how the shell function library stuff should work (e.g. the stuff which
goes into /usr/lib/shell/ksh/<organisation>/<module>/<submodule>/, e.g.
/usr/lib/shell/ksh/org/opensolaris/net/http/ for HTTP-related ) ...

> Always use '{'+'}' when using variable names longer than one character.
>         I would allow the {} to be omitted for simple named variables
>         that are followed by a blank, /, ;, or $.

Mhhh... I am not sure whether it's a good idea to add too many
exceptions...

> Always put variables into quotes when handling filenames or user input.
>         There is no need for quotes with assignment, redirection words or
>         inside [[...]].  They can also be omitted if IFS='' and set -o noglob.

I've added a note for this:
-- snip --
<note><para>
As alternative a script may set <literal>IFS='' ; set -o
noglob</literal> to turn off the
interpretation of any field seperators and the pattern globbing.
</para></note>
-- snip --

> Use compound variables or associative arrays to group similar variables 
> together.
>         typeset -A -E box=( "width"=56 "height"=10 depth=19 )
>         is not correct.  It should be
>         typeset -A -E box=( [width]=56 [height]=10 [depth]=19 )

Fixed.

> Put $LINENO] in your PS4
>         I think that you meant [$LINENO], or $LINENO.

Fixed.

----

Bye,
Roland

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

Reply via email to