Dollar Character in Front of Double Quotes in Bash

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

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

+4
source share
1 answer

As described in the bash manual , it is used for localization:

A double-quoted string preceded by a dollar sign ('$) will result in a string that will be translated according to the current locale. If the current language is C or POSIX, the dollar sign is ignored. If a string is translated and replaced, the replacement is performed in a double way.

+10
source

Source: https://habr.com/ru/post/1481896/


All Articles