Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我最近阅读了一些 bash 代码echo $"asdf",这是$为了什么?
echo $"asdf"
$
$"asdf"和 just 和有什么不一样"asdf"?
$"asdf"
"asdf"
如bash 手册中所述,它用于本地化:
前面有美元符号 ('$') 的双引号字符串将导致根据当前语言环境翻译该字符串。如果当前语言环境是 C 或 POSIX,则忽略美元符号。如果字符串被翻译和替换,则替换是双引号。