[plug] login problem

Matt Kemner zombie at penguincare.com.au
Fri Aug 9 00:43:59 WST 2002


On Fri, 9 Aug 2002, quoth Craig Dyke:

> In .bashrc i have a line which reads:
>
>     test -f .alias && source .alias
>
> My problem is that if i login at a console my .alias file is never
> sourced.

.bashrc is only read by non-login shells, .bash_profile is only read y
login shells.  A login shell is the shell you log in to (ie the very first
shell that runs after you log in)

My solution is to put all my aliases/variables in .bashrc and source
.bashrc from .bash_profile

> Also, if i su in to this user from root the aliases don't work, but
> if i su - user then they do???

The - tells su to run the user's shell as a login shell.

 - Matt



More information about the plug mailing list