I have an ZSH alias:
alias -g ...='../..'
alias -g ....='../../..'
When I try to cd ...
, things work perfectly. I can't, however, use it in a cp
command: cp .../file .
fails with cp: .../file: No such file or directory
.
In addition, trying to use the alias such: cd .../dir
fails: cd:cd:10: no such file or directory: .../dir
. Doing the same thing using cd ...; cd dir
works fine.
From the zsh-lovers page:
Global aliases can be used anywhere in the command line. Example:
$ alias -g C='| wc -l'
$ grep alias ~/.zsh/* C
443
The ZSH Introduction also says that global aliases are substituted anywhere in the command line.
Why aren't my aliases being used as I thought they should be?