Strings at a glance
In the terminalela --spec strings-at-a-glance
| Write | It holds | Example |
|---|---|---|
"..." | text with $x, ${expr} and $(cmd) worked out, and escapes: \n, \t, \$ | "built $name in ${len($files)} files" |
'...' | text as written, on one line, $ and \ included | 'cost: $5' |
`...` | text as written, in code only, a ' included | re.match(`^v\d+$`, $tag) |
""", ''' | several lines, from the line after the marker to the closing marker on a line of its own, the last line's newline included; ''' as written | msg = """ ... """ |
- A
$as written goes in'...'or''', or as\$in"...". - A
'in text goes in"...","it's done", or in backticks in code. $(in"..."runs the command, wherever the text goes:"run $(git status) first"puts git's output in the text.- Text joins by interpolation,
"$a-$b"or"${a}${b}", never+. - A call's value prints through
${...}:echo ${str.upper($name)}.echo str.upper($name)stops before line 1. \nis a line break only in"..."; in'...'it is a backslash and ann.
(ela --spec quotes)