- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.9k
 
SC2247
        Joachim Ansorg edited this page Nov 12, 2021 
        ·
        2 revisions
      
    var=$"(whoami)"var="$(whoami)"ShellCheck has found a $"( or $"{ . This is most likely due to flipping the dollar-sign and double quote:
echo $"(cmd)"  # Supposed to be "$(cmd)"
echo $"{var}"  # Supposed to be "${var}"
Instead of quoted substitutions, these will be interpreted as localized string resources ($"..") containing literal parentheses or curly braces. If this was not intentional, you should flip the " and $ like in the example.
If you intentionally wanted a localized string literal $".." that starts with ( or {, either ignore this error or start it with a different character.
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!