[offtopic] Re: [PLUG] .profile

Matt Hoover matt@hoov.net
Thu, 2 Sep 1999 01:24:58 -0500 (EST)


I am not familiar with the Purdue servers, but when I use bash the config
file is called .bash_profile - I supose this can change on other platforms
:)  This is for bash 2.03.......

-Matt


On Thu, 2 Sep 1999, Richard June wrote:

> Jonathan Sergent wrote:
> 
> > BTW, this is off topic.  I suggest that general Unix questions are
> > probably better off on the one or more of the purdue.* newsgroups.
> >
> > /// HarleY <harley@quasar.ground.dynip.com>:
> >  ]      I created my .profile in my home directory on expert.
> >  ] The problem is that most things are working like the umask ect, but
> >  ] I installed bash on expert and put it in my homedir.  I put a line in my
> >  ] .profile that looks something like this
> >  ] ~/bash -l
> >  ] However bash doesn't exicute when I log in.  I think it may have to do
> >  ] with the fact that bash isn't listed in /etc/shells.  Is there a way
> >  ] around this?  I'd really like bash as my default shell.
> >
> > ~/ does not work with /bin/sh.  If your shell is /bin/sh, you will
> > need to say $HOME.
> >
> > Also, you don't say "exec bash" and so once you exit bash, you will
> > get back to your normal shell before you log out.
> >
> > And even worse, bash also reads .profile on startup, and this will
> > send it into a loop, starting lots of processes.  Fortunately, you
> > have a per-user process limit on expert, or you could easily crash
> > a machine with this (bash is not small).
> >
> > Suggestion: chsh to csh and then make a ".login" that says:
> >
> > if ( "${TERM}" != "" ) then
> >         setenv SHELL ${HOME}/bin/bash
> >         exec ${HOME}/bin/bash -l
> > endif
> >
> > This avoids the .profile problem since csh doesn't use it.
> > The problem with _this_ is that if you use rsh, your commands get run
> > by csh instead of an sh type shell, so some things won't work like they
> > should.
> >
> > The setenv is important, or you may end up with csh for your subshells
> > instead of bash.
> >
> > You can work this with some stuff in your .profile, but it tends to be
> > shell-dependent (i.e. different between bash and ksh) and system-dependent
> > (i.e. different between pdksh on Linux and ksh-88i on Solaris) to
> > determine whether the shell you are running in is a login shell or
> > a subshell of some sort.  It's possible, but tricky, and limits you
> > from sharing your home directory and init files between architectures a
> > bit more.  Personally, when I need to pull this kind of trick, I set my
> > login shell to csh and do a .login as above.  You may need to fiddle a
> > bit more if you intend to use CDE from the account you do this to.
> 
> couldn't he just do this in his .profile
> 
> if [1 -f  ${HOME}/tmp/login ]; then
>   touch ${HOME}/tmp/login
>   exec ${HOME}/bash -l
>   rm ${HOME}/tmp/login
> fi;
> 
> 
> ____________________________________________________
> The Purdue Linux Users' Group (PLUG) mailing list.
> plug mailing list  -  plug@csociety.purdue.edu
> http://csociety.ecn.purdue.edu/mailman/listinfo/plug
>