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
The \ns aren't a problem, but the single quotes around 'eslint:recommended' are. I've also never seen $'something' before. Edit. Should have read the doc. First point stands tho.
In your example, you echo multiple strings that are concatenated and not one long string. As per spec:
Enclosing characters in single quotes (‘'’) preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.
Here is the output of the echo command on my machine:
A string enclosed between ‘$’’ and ‘’’ is processed the same way as the string arguments of the print builtin, and the resulting string is considered to be entirely quoted. A literal ‘’’ character can be included in the string by using the ‘\’’ escape.
Luckily, the doc for print doesn't mention how string arguments are processed... At least, I couldn't find it. If I had to guess, then zsh requires a space (or the end of the command/line) after the second ' for it to be the closing quote.
Anyway, the zsh behavior is incompatible with bash and won't be supported in the bash language.
Activity
RunDevelopment commentedon Jun 27, 2020
The
\ns aren't a problem, but the single quotes around'eslint:recommended'are.I've also never seenEdit. Should have read the doc. First point stands tho.$'something'before.RunDevelopment commentedon Mar 7, 2021
Prism's highlighting is (mostly) correct.
In your example, you echo multiple strings that are concatenated and not one long string. As per spec:
Here is the output of the echo command on my machine:
That being said, I'll add support for ANSI-C Quoting.
smhmd commentedon Mar 7, 2021
I see. So, ANSI-C quotes behave differently in

bashandzsh.RunDevelopment commentedon Mar 7, 2021
That's interesting. zsh docs says this:
Luckily, the doc for
printdoesn't mention how string arguments are processed... At least, I couldn't find it. If I had to guess, then zsh requires a space (or the end of the command/line) after the second'for it to be the closing quote.Anyway, the zsh behavior is incompatible with bash and won't be supported in the bash language.