You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Joachim Ansorg edited this page Jul 5, 2024
·
7 revisions
Did you forget to close this double-quoted string?
Problematic code:
greeting="hellotarget="world"
Correct code:
greeting="hello"
target="world"
Rationale:
The first line is missing a quote.
ShellCheck warns when it detects multi-line double quoted, single quoted or backticked strings when the character that follows it looks out of place (and gives a companion warning SC1079 at that spot).
Exceptions
If you do want a multiline variable, just make sure the character after it is a quote, space or line feed.
var='multiline'value
can be rewritten for readability and to remove the warning: