Subject: Re: ksh [was: Re: miniroot for NetBSD/i386?]
To: Simon J. Gerraty <sjg@crufty.net>
From: Igor Sobrado <igor@string1.ciencias.uniovi.es>
List: port-i386
Date: 03/20/2006 00:59:37
In message <20060319165816.B36AF6666@void.crufty.net>, "Simon J. Gerraty" writes:
> >In my humble opinion, these configuration files are too complex and
> >too large.  These files can be exported from a centralized filesystem
> 
> Possibly.   But they've worked well for the last 15-20 years.

I certainly believe it!  These scripts look clean and well
designed.  They have some useful comments and some OS-specific
sections on them.  I do not doubt these scripts work nicely.

> >(e.g., by NFS) to a large number of clients running different Unix
> >and BSD flavours.  On the wrong side, these files are difficult to
> >maintain and, probably, a bit slow when users log in to the system.
> 
> >case $- in
> >*i*)	# do things for interactive shell
> 
> I use this in ksh.* since ksh is known to support it
> but my /etc/profile works with pretty well any bourne shell,
> So makes as few assumption as possible.

This case/esac structure should be supported by any standard Bourne-like
shell.  It is not for Korn shell, though.  Perhaps I am wrong, but
I never had problems with this initialization file in Bourne shells
either.

> I also much prefer writing a portable script, than N different
> versions of the same one - much harder to maintain.
> But yes I do make use of the . file.<subtype> model.

Setting the $ENV variable as outlined in my previous message will
allow moving the OS-specific parts of the initialization script to
~/.profile.<uname> files that will be executed automatically.
Certainly it is not clean installing ten or so ~/.profile.* files
in the users home directories.  It was just a though to make these
initialization scripts short.

I really like your scripts and will carefully look at them.  I am
sure, I will learn a lot from them.

Best regards,
Igor.