Mailing List Archive

.bashrc not working?
i added the following to my .bashrc file and it works locally but when i
ssh in from somewhere else it doesnt work any more. is there something i
need to do differently to get it to work via ssh?

# colors for ls, etc.
eval `dircolors -b /etc/DIR_COLORS`
alias l="ls -Al --color=auto"
alias df="df -h"

why would they work locally and not remotely?

thanks

nick

--
gentoo-user@gentoo.org mailing list
Re: .bashrc not working? [ In reply to ]
Korthrun wrote:

>On Wed, 29 Sep 2004 20:27:31 +0000, Nick Smith <nick@computernick.com>
wrote:
>
> >i added the following to my .bashrc file and it works locally but when i
> >ssh in from somewhere else it doesnt work any more. is there something i
> >need to do differently to get it to work via ssh?
> >
> ># colors for ls, etc.
> >eval `dircolors -b /etc/DIR_COLORS`
> >alias l="ls -Al --color=auto"
> >alias df="df -h"
> >
> >why would they work locally and not remotely?
> >
> >thanks
> >
> >nick
> >
> >--
> >gentoo-user@gentoo.org mailing list
> >
> >
>

> Does your .bash_profile contain something like:
>
> if [ -f ~/.bashrc ]; then
> . ~/.bashrc
> fi
>
> If so, I would suggest starting with /etc/profile and seeing why
> .bash_profile is not getting read. Otherwise just add that in.
>
actually i didnt have a .bash_profile file, so i created it and added
the above and it seems to be working, thanks for your help

nick

--
gentoo-user@gentoo.org mailing list
.bashrc not working? [ In reply to ]
On Wed, 29 Sep 2004 20:27:31 +0000, Nick Smith <nick@computernick.com> wrote:
> i added the following to my .bashrc file and it works locally but when i
> ssh in from somewhere else it doesnt work any more. is there something i
> need to do differently to get it to work via ssh?
>
> # colors for ls, etc.
> eval `dircolors -b /etc/DIR_COLORS`
> alias l="ls -Al --color=auto"
> alias df="df -h"
>
> why would they work locally and not remotely?
>
> thanks
>
> nick
>
> --
> gentoo-user@gentoo.org mailing list
>
>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Does your .bash_profile contain something like:

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

If so, I would suggest starting with /etc/profile and seeing why
.bash_profile is not getting read. Otherwise just add that in.

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.2

iQA/AwUBQVtVCUJNESz0+cxBEQK75QCg4Q/mKKRsDrbxV4FcETxa+JLZYxEAoPJu
9yVM4e3RC7XpfpyXMbnteQKl
=5IDt
-----END PGP SIGNATURE-----


--
() The ASCII Ribbon Campaign - against HTML Email,
/\ vCards, and proprietary formats.

--
gentoo-user@gentoo.org mailing list
Re: .bashrc not working? [ In reply to ]
On Wed, 2004-09-29 at 16:58, Nick Smith wrote:
> actually i didnt have a .bash_profile file, so i created it and added
> the above and it seems to be working, thanks for your help

In case you're wondering why it's working like that (this is something
that confused me years ago, and I wish it was explained more often in
newbie Linux documentation/tutorials/whatever), what's going on is this:

Bash can be invoked as a "login" shell (e.g. when you login from the
console, or ssh in), or an "interactive" shell (e.g. opening up an
xterm).

When invoked as a login shell, bash first reads /etc/profile, and then
reads ~/.bash_profile. It does NOT read ~/.bashrc. When invoked as an
interactive shell, bash reads ~/.bashrc (but NOT /etc/profile or
~/.bash_profile).

This makes it possible to have different stuff set depending on whether
you're in a console or an xterm. I've never needed to do that, though,
so I always do what was already recommended to you--put all my settings
in ~/.bashrc, and make ~/.bash_profile read ~/.bashrc.

Tom


--
gentoo-user@gentoo.org mailing list
Re: .bashrc not working? [ In reply to ]
On Thu, 2004-09-30 at 18:29, Bill Davidson wrote:
> Actually, it explained rather well in the Bash Guide For Beginners at tldp.
> http://www.tldp.org/guides.html
>
> I didn't link straight to the guide because it's available in many formats.

Sure, it's in a guide that's specifically for bash--which most Linux
newbies aren't reading. More likely, a newbie is reading some generic
(or distro-specific) guide on getting started with Linux, which might
direct them to put some aliases or a PS1 in ~/.bashrc or whatever, and
then doesn't explain why their settings aren't always being used.

Tom


--
gentoo-user@gentoo.org mailing list
Re: .bashrc not working? [ In reply to ]
On 22:20 Wed 29 Sep , Thomas J. Hamman wrote:
> On Wed, 2004-09-29 at 16:58, Nick Smith wrote:
> > actually i didnt have a .bash_profile file, so i created it and added
> > the above and it seems to be working, thanks for your help
>
> In case you're wondering why it's working like that (this is something
> that confused me years ago, and I wish it was explained more often in
> newbie Linux documentation/tutorials/whatever), what's going on is this:

Actually, it explained rather well in the Bash Guide For Beginners at tldp.
http://www.tldp.org/guides.html

I didn't link straight to the guide because it's available in many formats.

Bill

--
gentoo-user@gentoo.org mailing list