Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Sep 2007 17:39:41 +0200
From:      Mel <fbsd.questions@rachie.is-a-geek.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: bash on login.
Message-ID:  <200709061739.41650.fbsd.questions@rachie.is-a-geek.net>
In-Reply-To: <20070906150602.GE61602@pcjas.obspm.fr>
References:  <20070906150602.GE61602@pcjas.obspm.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 06 September 2007 17:06:02 Albert Shih wrote:

> I'm using bash for standard shell, what I don't understand is when I'm
> connect by ssh on my server the bash don't parse .bashrc file.

man bash, section INVOCATION:
       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.

...

       When an interactive shell that is not a login shell  is  started,  bash
       reads  and executes commands from ~/.bashrc, if that file exists.  This
       may be inhibited by using the --norc option.  The --rcfile file  option
       will  force  bash  to  read  and  execute commands from file instead of
       ~/.bashrc.

Ssh is a login shell.

For most practical uses:
cat ~/.bashrc >> ~/.bash_profile && rm -f ~/.bashrc
and live happily ever after.

-- 
Mel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709061739.41650.fbsd.questions>