I'm having trouble getting the Ruby Version Manager rvm to source from my Ubuntu 10.04 .profile. The code:
[[ -s "$HOME/.rvm/scripts/rvm" ] && . "$HOME/.rvm/scripts/rvm"
...never does what I expect it to (i.e. give me the rvm program when I open a new shell or start a new session); but if I execute
source .profile
in a new shell after logging in, it works! Why will it work when I manually source it, but not automatically at login?
#!/bin/bash
. Depending on the way you are logging in check whether .profile is really used (e.g.PROFILE_USED=1; export PROFILE_USED
). If it is, it may be run by the wrong shell (it is only really meant to be run by /bin/sh "or better"); if it is not, try .xprofile. You're missing a ], too, but that's probably a typo here.