我最近看了一些bash代码,echo $"asdf"
,$
是做什么用的?
$"asdf"
和 "asdf"
有什么区别?
最佳答案
如 bash manual 中所述,它用于本地化:
A double-quoted string preceded by a dollar sign (‘$’) will cause the string to be translated according to the current locale. If the current locale is C or POSIX, the dollar sign is ignored. If the string is translated and replaced, the replacement is double-quoted.
关于bash - Bash 中双引号前的美元字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16665348/