Re: aliases in .profile don't work?
- From: MR ZenWiz <mrzenwiz@xxxxxxxxx>
- Date: Wed, 8 Dec 2010 16:01:38 -0800
On Wed, Dec 8, 2010 at 3:19 PM, Marius Gedminas <marius@xxxxxx> wrote:
On Wed, Dec 08, 2010 at 02:46:25PM -0800, Knute Johnson wrote:This is not standard behavior - there is no special handling of
Anybody know why putting an alias in ~/.profile doesn't work but putting
it in ~/.bash_aliases does?
~/.profile is sourced for login sessions only (both ssh logins and gdm
logins, the latter thanks to Ubuntu's /etc/gdm/Xsession). Aliases
aren't exported via the environment, so any new shell sessions -- such
as those you get by opening a terminal window -- do not inherit them.
~/.bash_aliases is sourced for every new shell session.
~/.bash_aliases built into bash.
When bash is invoked as a login shell, it first reads /etc/profile if
that file exists, then it looks for the first of ~/.bash_profile,
~/.bash_login and ~/.profile, in that order, to execute whatever it
finds there.
Interactive bash shells that are not login shells (i.e., scripts or
direct invocations from the command line) read and execute
/etc/bash.bashrc and then ~/.bashrc, if these files exist.
These are the places to look, in that order, to see what's happening.
I generally prefer to have a consistent environment for execution, so
I set my .bash_profile to source .bashrc and have all my settings in
.bashrc. I keep my aliases and functions in separate files that my
.bashrc sources explicitly.
(Above taken directly from 'man bash' on Maverick.)
True, and this will also affect most other shells as well, as~/.bash_profile or ~/.bash_login do NOT
exist. Adding a change to the PATH works just fine in ~/.profile.
PATH is usually exported via the environment, so setting it in ~/.profile
is sufficient.
~/.profile is more or less universal (except for csh).
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- Follow-Ups:
- Re: aliases in .profile don't work?
- From: Marius Gedminas
- Re: aliases in .profile don't work?
- References:
- aliases in .profile don't work?
- From: Knute Johnson
- Re: aliases in .profile don't work?
- From: Marius Gedminas
- aliases in .profile don't work?
- Prev by Date: Re: CPU frequency went down
- Next by Date: Re: keyboard mapping problem
- Previous by thread: Re: aliases in .profile don't work?
- Next by thread: Re: aliases in .profile don't work?
- Index(es):
Relevant Pages
|