nfpyfzyf
nfpyfzyf

Reputation: 2991

Dollar character before double quotes in Bash

I recently read some bash code, echo $"asdf", what is $ for?

What is the difference between $"asdf" and just "asdf"?

Upvotes: 7

Views: 1459

Answers (1)

dogbane
dogbane

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

Related Questions