Re: Why is this not working?

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 05/28/04

  • Next message: Michael Kelly - FMEC ~: "Re: Looking for a UNIX Poster"
    Date: Fri, 28 May 2004 17:13:19 -0400
    
    

    In article <slrncbepev.14o.stephane.chazelas@spam.is.invalid>,
     Stephane CHAZELAS <this.address@is.invalid> wrote:

    > 2004-05-28, 11:30(-04), Barry Margolin:
    > >
    > >> But if you make it a login shell, it won't read .bashrc, will it? It will
    > >> read .profile and .bash_login...
    > >
    > > No, login shells execute *both* .profile and .bashrc.
    > >
    >
    > Only if you have a ". .bashrc" in your ".profile".
    > That's not very intuitive, I agree.

    You're right. I was thinking of csh/tcsh, which executes both .login
    and .cshrc when a login shell starts up.

    I wonder why bash did it this way. .profile is for things you want done
    once per login session, but .bashrc is for things that should be done in
    every interactive shell. Why wouldn't you want the latter to be done in
    a login shell? For the rare cases where you don't want this, there
    could be something like "set nobashrc" to suppress loading the .bashrc
    after .profile.

    -- 
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    

  • Next message: Michael Kelly - FMEC ~: "Re: Looking for a UNIX Poster"

    Relevant Pages

    • SUMMARY: how to set correct path?
      ... ven if we login with ssh. ... For BASH login shell, place the system wide ENV variables, such as PATH, ... You can set Use_login in the sshd_config to yes and restart sshd. ...
      (SunManagers)
    • Re: Shell confusion
      ... comment about a login shell, ... -bash: xorg.conf: command not found ... root environment which moves me back to /root. ...
      (Fedora)
    • Re: $PATH and /etc/profile
      ... think the debian maintainers would have done this a long time ago? ... > starting X from a login shell. ... .xsession is there for users to set up their system. ... > at their X scripts the xsession is exec'd through a login shell precisely as ...
      (Debian-User)
    • Re: consent to monitoring banner for ssh
      ... # Note that output goes into the .xsession-errors file for easy debugging ... You don't need set the everyone's login shell, ... everyone's login shell to a locally-written perl script. ...
      (RedHat)
    • Re: Detailed logging of ssh sessions
      ... >via ssh). ... come in some way from the login shell. ... I'd just experiment with using script in some way ...
      (freebsd-questions)