-
Notifications
You must be signed in to change notification settings - Fork 1.9k
SC1003
Mingye Wang edited this page Feb 27, 2016
·
9 revisions
echo 'You\'re doing it wrong' # unclosed single quoteecho 'You'\''re doing it wrong'
echo $'You\'re doing it wrong' # ksh/bash/zsh "c-style" quoteIn POSIX shell, the shell cares about nothing but another single quote to terminate the quoted segment. Not even backslashes are interpreted.
POSIX.1 Shell Command Language § 2.2.2 Single Quotes:
Enclosing characters in single-quotes (
'') shall preserve the literal value of each character within the single-quotes. A single-quote cannot occur within single-quotes.