In my laptop, if I type below
$ which vi
alias vi='vim'
/usr/bin/vim
Now I want to change the vi alias to another bin, e.g. vim_wrapper a script created in /usr/bin/, I type this line:
alias vi="vim_wrapper"
in ~/.bashrc or /etc/bashrc, but take no effects. So How to change the default vi alias vi='vim' to vi='vim_wrapper'? Thanks for help!
sourcethe file (instead of running it with~/bashrcon its own), otherwise the changes will not be reflected in the terminal. So, either do. ~/.bashrcorsource ~/.bashrc. – Nitrodist May 25 '11 at 17:40.bashrcand I execute the script instead of sourcing it, then that exported variable disappears after the script finishes executing. See http://superuser.com/questions/176783/what-is-the-difference-between-executing-a-bash-script-and-sourcing-a-bash-script http://stackoverflow.com/questions/1107808/what-happens-when-i-execute-a-unix-shell-script-using-a-command and http://stackoverflow.com/questions/1880735/difference-between-launching-a-script-with-script-sh-and-script-sh – Nitrodist May 25 '11 at 18:21aliascommand, but that wasn't very clear in my post. I've updated it. – Patches May 25 '11 at 19:05