在zsh中取消别名的全局别名 [英] Unaliasing a global alias in zsh

查看:165
本文介绍了在zsh中取消别名的全局别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在zsh shell中使用 alias -g定义了全局别名。当我尝试取消别名时,shell会引发以下错误: unalias:无此类哈希表元素。



关于如何取消别名的任何指针?

解决方案

您需要在尝试 unalias 时对其进行转义。尝试说:

  unalias \aliasname 

而不是

  unalias别名






由于它是全局别名,除非您对其进行转义,否则Shell会将其替换为命令行上的任何位置。 / p>

I had defined a global alias in my zsh shell using "alias -g" . When I am trying to unalias it, the shell throws the following error : "unalias: no such hash table element".

Any pointers on how to unalias a globally defined alias?

解决方案

You need to escape it while attempting to unalias. Try saying:

unalias \aliasname

instead of

unalias aliasname


Since it's a global alias, the shell would substitute it anywhere on the command line unless you escape it.

这篇关于在zsh中取消别名的全局别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆