fix permissions on .bash_profile
.bash_profile
should normally be owned by the user, not by root.
I'd suggest reverting it back to the right user using sudo chown myUserName /Users/myUserName/.bash_profile
and then stop using that sudo command completely. There should be no need to have superuser power to edit that file to start with.
IMHO you're making it more difficult than it needs to be.
do not edit your files with root permissions.
Once you restore the normal ownership, groups and permissions, all you need is to type
nano ~/.bash_profile
or whatever your favorite editor might be.
sudo in front of a command uses superuser (root) as the effective userid, use it sparingly and intentionally. It's a bit like the dark side of the force: yes the superuser can do more, but once you start using it, going back to the light side is difficult as all your stuff will be owned by the superuser and you'll start seeing things fail that should not fail.
Apply an edited .bash_profile in an already running shell
A copy of bash already running will not automagically pick up any change you make to your .bash_profile . It needs to be told to pick up the changes.
Either you start a new shell by starting another terminal.
Or you can also apply some changes (but maybe not undo all what was in the original!) .bash_profile by "sourcing" the file:
. ~/.bash_profile
will do that for you - but there are limits to what it can do (e.g. if you defined an alias for ls, removing that line and sourcing the bash_profile again will NOT remove the alias form your running shell, you'll have to do it yourself, or quit that shell.
See also: