Re: bash startup scripts - what is an "interactive login" ??

2005-07-12 Thread Bob Proulx
Chris F.A. Johnson wrote:
> Mark D. Hansen wrote:
> > Can anyone clarify for me when the ~/.bash_rc and /etc/bash.bashrc
> > scripts get sourced?
> 
>  ~/.bash_rc is not a standard file; do you mean ~/.bashrc?

I am sure that is the case.

>  /etc/bash.bashrc is usually sourced in /etc/profile.

Not on Debian.  I think you must be thinking of a different system. :-)

> > If I create a new xterm do these scripts get sourced or is it only
> > if I do an rlogin, ssh, login ,etc?
> 
>   If you call xterm with the -ls option, it opens a login shell,
>   i.e., one which sources /etc/profile and ~/.bash_profile.
> 
>   If the shell is interactive, but not a login shell (e.g., xterm
>   without -ls), it sources ~/.bashrc.

You are probably confused by the fact that Debian's xdm, kdm, gdm
login does not start the user shell as a login shell and so the
~/.bash_profile is not sourced at login the same as a text console
login.  Create a ~/.xsession as a login shell as already described
several times this week on this list and it will source your
~/.bash_profile at login.

Bob


signature.asc
Description: Digital signature


Re: bash startup scripts - what is an "interactive login" ??

2005-07-12 Thread Andrew Schulman

> Can anyone clarify for me when the ~/.bash_rc and /etc/bash.bashrc
> scripts get sourced?  I read from the man and googling that it is
> only when an "interactive login" shell is created, but what does
> that mean?  If I create a new xterm do these scripts get sourced
> or is it only if I do an rlogin, ssh, login ,etc?

All of your questions are answered in the man page, under INVOCATION.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: bash startup scripts - what is an "interactive login" ??

2005-07-12 Thread Chris F.A. Johnson
On 2005-07-12, Mark D. Hansen wrote:

> Can anyone clarify for me when the ~/.bash_rc and /etc/bash.bashrc
> scripts get sourced?

 ~/.bash_rc is not a standard file; do you mean ~/.bashrc?

 /etc/bash.bashrc is usually sourced in /etc/profile.

 Both files can be sourced any time you want them to be.

> I read from the man and googling that it is only when an
> "interactive login" shell is created, but what does that mean?

man bash:

   A login shell is one whose first character of argument zero  is  a
   -, or one started with the --login option.

   An  interactive  shell is one started without non-option arguments
   and without the -c option whose standard input and error are  both
   connected  to  terminals  (as  determined  by  isatty(3)),  or one
   started with the -i option.  PS1 is set and $- includes i if  bash
   is  interactive, allowing a shell script or a startup file to test
   this state.

> If I create a new xterm do these scripts get sourced or is it only
> if I do an rlogin, ssh, login ,etc?

  If you call xterm with the -ls option, it opens a login shell,
  i.e., one which sources /etc/profile and ~/.bash_profile.

  If the shell is interactive, but not a login shell (e.g., xterm
  without -ls), it sources ~/.bashrc.

-- 
Chris F.A. Johnson 
==
Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



bash startup scripts - what is an "interactive login" ??

2005-07-12 Thread Mark D. Hansen
Can anyone clarify for me when the ~/.bash_rc and /etc/bash.bashrc scripts get 
sourced?  I read from the man and googling that it is only when an "interactive 
login" shell is created, but what does that mean?  If I create a new xterm do 
these scripts get sourced or is it only if I do an rlogin, ssh, login ,etc?

Thanks,

Mark