Zsh

如何將 ZSH 命令替換配置為不使用反引號 (`)?

  • March 6, 2019

我只想echo $(date)返回日期而不是反引號版本。

echo $(date) # should return Wed Mar 6 09:50:41 EST 2019
echo `date` # should return `date` 

將反引號括在字元串引號中以消除它們的 subshel​​ly 權力:

$ echo '`echo`'
`echo`

但請注意,收縮用強引號括起來:

$ echo 'I can't process this.'
> Oh whoops that ">" means we're still in a strong quote.
I cant process this.
Oh whoops that ">" means were still in a strong quote.

引用自:https://unix.stackexchange.com/questions/504731