Check out the bash command 'shopt -s cdable_vars' From the man bash page: If set, an argument to the cd builtin command that is not a directory is assumed to be the name of a variable whose value is the directory to change to.
- # in .bash_profile or other suitable location
- shopt -s cdable_vars
- export ne="/etc/network/"
- # in the shell
- source .bash_profile # (just this once, to reload the edited file)
- cd ne
- pwd # /etc/network/
You need to login to post a comment.