I’d like the create the alias -- for the bash cd - command. Searching to solve this problem, I found the advice to use this alias:
alias -- -="cd -"
However, that leads to the following error, as seen in this session snippet:
chris@DeathStar:~$ cd .vim
chris@DeathStar:~/.vim$ --
-bash: --: command not found
chris@DeathStar:~/.vim$
My bash --version:
GNU bash, version 4.2.39(2)-release (i386-apple-darwin12.2.1)
Copyright (C) 2011 Free Software Foundation, Inc.
Any ideas?
Don’t bother with aliases. Use a function instead: