I have a file called ~/.gotorc and in it I have
alias goto_usr="cd /usr"
alias goto_bin="cd /user/local/bin"
Then in my .zshrc I have
source ~/.gotorc
goto() {
`goto_$1`
}
But when I run goto bin, it says goto:bin: command not found: goto_bin. But if I run goto_bin then it works and I go to the expected folder.
How come?
.zshrcis used withzsh, notbash. You want to use.bashrcinstead.