Erik Troan <[EMAIL PROTECTED]> writes:

> On Wed, 3 Oct 2001, Harry Putnam wrote:
>
>> One thing that would help would be to heavily comment all init
>> scripts.  Maybe this isn't done because they change frequently or
>> maybe it is just assumed that any one paging thru them will be able
>> to follow the code easily, which is absolutely wrong in my opinion.
>> 
>
> It's not done because we're understaffed, and just haven't had time. We
> agree that it should be done, fwiw.
>
>> Admittedly I am a rank amateur script writer but I usually have 40
>> percent or more comments in scripts that I expect to come back to at
>> some future date.  And still sometimes have trouble seeing what I was
>> trying to do.
>
> I'm not going to pretend that our init scripts are readable but rank
> amatuer script writers. Many of them are complicated, but they should
> all be comprehensible.

I may have overplayed the `rank amateur a bit.  I've written well over
a hundred scripts, maybe over 200.  Some considerabley more
complicated than the one I site.  But...
   
>>    if [ -f /etc/sysconfig/i18n -a -z "$NOLOCALE" ] ; then
>>      . /etc/sysconfig/i18n
>>      if [ "$LANG" = "ja_JP.eucJP" -a "`/sbin/consoletype`" != "pty" ]; then
>>        unset LANG
>>      else
>>        export LANG
>>      fi
>>    fi
>>    
>>    # Read in our configuration
>>    [...]
>> 
>> Note there is no clue whatever as to what the `if' clauses are doing.
>
> This is all really basic shell scripting. "man test" would make good reading
> some time, fwiw.

Since it is so basic one should have no trouble explaining what is
happening there.  You may find you need to know what $NOLOCALE refers
to. 

OOOPs  .. no referernce to it anywhere in this script accept in
this if clause.  Now what condition might make me want to source 
/etc/sysconfig/i18n?  In fact what is i18n?  But at least there I have
a file to lookup.

This might make knowing what it means when $NOLOCALE has no value a
bit hard to figure out.  Knowing where to track this down ... now that
is not so terribly basic.

When I refererence Vars in a script and it is not apparent where the
VAR comes from, (i.e. When it isn't defined in the current script) I
often put [Ref: /path/file] in a comment.  But then I'm not
understaffed....



_______________________________________________
Seawolf-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/seawolf-list

Reply via email to