我刚刚在初始化脚本中看到了这一点:
echo $"Stopping Apache"
那美元符号是做什么用的?
到目前为止,我的研究:
我在bash手册中发现了这一点:
引号
如果设置,
$'string'
并且$"string"
加引号内执行${parameter}
双引号括起来的扩展。默认情况下启用此选项。
...但是我没有发现带有和不带有$
前缀的字符串之间的任何区别:
$ echo "I am in $PWD"
I am in /var/shared/home/southworth/qed
$ echo $"I am in $PWD"
I am in /var/shared/home/southworth/qed
$ echo $"I am in ${PWD}"
I am in /var/shared/home/southworth/qed
$ echo "I am in ${PWD}"
I am in /var/shared/home/southworth/qed
$ echo 'I am in ${PWD}'
I am in ${PWD}
$ echo $'I am in ${PWD}'
I am in ${PWD}
$ echo $'I am in $PWD'
I am in $PWD
$"..."
根据问题,没有提及。