bash - Bash 中双引号前的美元字符

标签 bash

我最近看了一些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/

相关文章:

linux - 别名 <cmd> 到 "do X then <cmd>"透明

linux - 为什么/usr/bin/timeout 会杀死整个管道?

macos - 如何将 SQL 查询作为包含双引号的参数传递给 psql

linux - 使用 sed 将单词替换为空白

Linux 多个 FIND 语句和 IF 条件//bash

bash - 使用 Bash 脚本检查目录是否存在的奇怪错误

bash - Bash 中的组合日期和时间表示

linux - 如何以不同用户身份运行 bash 命令?

git - 有没有一种简单的方法可以删除未跟踪的 git 文件

regex - sed 命令 - 从 spec 文件中获取值并将其分配给 sh 文件中的变量