ela
Contents

ManualAgents

Strings at a glance

In the terminalela --spec strings-at-a-glance

WriteIt holdsExample
"..."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 ' includedre.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 writtenmsg = """ ... """
  • 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.
  • \n is a line break only in "..."; in '...' it is a backslash and an n.

(ela --spec quotes)