我用哦,MY-的zsh一個有.zshrc以下別名:別名遞歸執行上OSX
alias composer="php -d memory_limit=-1 $(which composer)"
我得到以下輸出:
$ composer
Could not open input file: composer:
併爲:
$ which composer
composer: aliased to php -d memory_limit=-1 composer: aliased to php -d memory_limit=-1 composer: aliased to php -d memory_limit=-1 /usr/local/bin/composer
$ zsh --version
zsh 5.2 (x86_64-apple-darwin15.4.0)
在Linux下,它按預期工作:
$ which composer
composer: aliased to php -d memory_limit=-1 /usr/bin/composer
$ zsh --version
zsh 5.3.1 (x86_64-unknown-linux-gnu)
做得很好;對非zsh用戶的說明:在zsh中,which是一個_builtin_,它也報告_aliases_的定義。 – mklement0