linux – zsh中等号有什么特殊含义?

linux – zsh中等号有什么特殊含义?,第1张

概述在我的zsh脚本中,我有一条线 echo some text ================================ 令我惊讶的是,为此行发出了错误消息: zsh: =============================== not found 从命令行进行试验,我发现当有一个等号时,shell会感到沮丧: $echo =zzsh: z not found 但在这里,我们有: $e 在我的zsh脚本中,我有一条线
echo some text ================================

令我惊讶的是,为此行发出了错误消息:

zsh: =============================== not found

从命令行进行试验,我发现当有一个等号时,shell会感到沮丧:

$echo =zzsh: z not found

但在这里,我们有:

$echo =echo/usr/bin/echo

从这个观察来看,它看起来好像

=XXX

会被解释为

$(which XXX)

但是,我没有在zsh联机帮助页中找到任何有关此“替换”的内容.这块魔法描述在哪里?

解决方法 从 docs:

14.7.3 ‘=’ expansion

If a word begins with an unquoted ‘=’ and the EQUALS option is set,
the remainder of the word is taken as the name of a command. If a
command exists by that name,the word is replaced by the full pathname
of the command.

和here在更多的话

总结

以上是内存溢出为你收集整理的linux – zsh中等号有什么特殊含义?全部内容,希望文章能够帮你解决linux – zsh中等号有什么特殊含义?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/yw/1033196.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存