Last modified: 2014-08-17 17:44:24 UTC
When you use 'become' to log into a shared account, ~/.bashrc isn't run. catrope@tools-login:~$ become visualeditor local-visualeditor@tools-login:~$ cat ~/.bashrc # Shortcuts alias ..='cd ..' alias ll='ls -ahlF --color=auto' alias l='ll' # Environment export PATH=$HOME/bin:$PATH; local-visualeditor@tools-login:~$ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin local-visualeditor@tools-login:~$ . ~/.bashrc local-visualeditor@tools-login:~$ echo $PATH /data/project/visualeditor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin Adding $HOME/bin to $PATH would probably be a nice thing to do in general.
Works as designed. become, through sudo, creates an interactive login shell. To quote from the bash info page: " When Bash is invoked as an interactive login shell, or as a non-interactive shell with the `--login' option, it first reads and executes commands from the file `/etc/profile', if that file exists. After reading that file, it looks for `~/.bash_profile', `~/.bash_login', and `~/.profile', in that order, and reads and executes commands from the first one that exists and is readable." A thing many users may want to do to simplify things is to have a ~/.profile that sources ~/.bashrc (in addition or instead of login-specific behaviour) so that the latter gets sourced regardless of how the shell was invoked.