[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash profile how?



On Wed, Jun 16, 2004 at 12:39:51PM -0400, Michael B Allen wrote:
> On Tue, 15 Jun 2004 23:36:25 -0600
> "s. keeling" <keeling@spots.ab.ca> wrote:
> 
> > Incoming from Michael B Allen:
> > > On Tue, 15 Jun 2004 22:15:24 -0400
> > > Paul Galbraith <paul@paulgalbraith.net> wrote:
> > > > 
> > > > 	#!/bin/bash --login
> > > > 	exec x-session-manager
> > > 
> > > Yes, I think this is my problem. But I don't understand what the
> > > reasoning is for this default configuration. Obviously if the
> > > .bash_profile and
> > 
> > Apparently, the two are dancing around each other, attempting to not
> > step on each other's toes.  Consequently, they both end up wrong.
> 
> Well I can appreciate having separate profiles for sh and bash. I have cron
> jobs and cgi scripts that need a certain consistent environment that differs
> from the environment used for development. But the problem is I cannot seem
> to locate the mechanism to trigger all shells derived from a user logon to
> be logon shells. Such a mechanism must exist or there would be no point in
> having separate profiles. Or perhaps disperate packagers are not
> coordinating?
> 

The difference between login shell and non-login shell is more
historical, if you look at console work. Most xterm-like programs allow
you to control whether the shell is a login shell or not, but if you do
su <user> in that window then you will never get a login shell.

There is a switch to the shell (for bash,sh its -l) to force a login
shell if you want.

I just have my .bash_profile and .bashrc do the same thing (I don't
remember which calls what, but everything uses the same settings in the
end).

If your cron jobs don't run as the regular user you can set the
settings for them in /etc/bash_... and override them for the regular
users in ~/.bash... otherwise maybe a check such as debian does for the
prompt will help you (check in the /etc/ files) it checks what kind of
environment you are in.

> Mike
> 
> -- 
> Greedo shoots first? Not in my Star Wars.
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 
>  
>  +++++++++++++++++++++++++++++++++++++++++++
>  This Mail Was Scanned By Mail-seCure System
>  at the Tel-Aviv University CC.
> 



Reply to: