Reputation: 2991
I recently read some bash code, echo $"asdf"
, what is $
for?
What is the difference between $"asdf"
and just "asdf"
?
Upvotes: 7
Views: 1459
Reputation: 274888
As documented in the bash manual, it is used for localization:
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.
Upvotes: 12