Subject: Re: Shell initialization
To: NetBSD help <netbsd-help@netbsd.org>
From: Alexander Sorg <Alexander.Sorg@indanet-gmbh.de>
List: netbsd-help
Date: 01/12/2000 10:56:15
"Marinier, M. Claude, G." wrote:
> How does one setup the various shell initialization files? I have not
> found much about this.
Look in the manpage of the shell. There should be a description of the
different startup-files.
> 
> I have one specific problem: some configure scripts fail because of my
> 'ls' alias. I use sh and bash. The issue is what goes in the /etc/profile,
> the ~/.bash_login (or ~/.profile), and the ~/.bashrc files.
In the /etc/profile file goes global (for all users) stuff. The
dot-files
in the user dirs are of course user-specific.
To prevent things like your ls-alias from interfering with scripts, you
should write an if-claus in your .profile, so that these aliases are
only assigned in interactive sessions. I just have an example how this
is done in csh:
#-------- csh example --------
if ($?prompt) then
        # An interactive shell -- set some stuff up
        set filec
        set history = 1000
endif
#-------- csh example --------
I don't know yet enough about sh to translate it apropriately.
Hope this helps.
Have fun,
   Alex.