Strings

Double-quoted strings support escape sequences:

string-with-tab             := "\t"
string-with-newline         := "\n"
string-with-carriage-return := "\r"
string-with-double-quote    := "\""
string-with-slash           := "\\"
string-with-no-newline      := "\
"
$ just --evaluate
"tring-with-carriage-return := "
string-with-double-quote    := """
string-with-newline         := "
"
string-with-no-newline      := ""
string-with-slash           := "\"
string-with-tab             := "     "

Strings may contain line breaks:

single := '
hello
'

double := "
goodbye
"

Single-quoted strings do not recognize escape sequences:

escapes := '\t\n\r\"\\'
$ just --evaluate
escapes := "\t\n\r\"\\"

Indented versions of both single- and double-quoted strings, delimited by triple single- or double-quotes, are supported. Indented string lines are stripped of a leading line break, and leading whitespace common to all non-blank lines:

# this string will evaluate to `foo\nbar\n`
x := '''
  foo
  bar
'''

# this string will evaluate to `abc\n  wuv\nxyz\n`
y := """
  abc
    wuv
  xyz
"""

Similar to unindented strings, indented double-quoted strings process escape sequences, and indented single-quoted strings ignore escape sequences. Escape sequence processing takes place after unindentation. The unindentation algorithm does not take escape-sequence produced whitespace or newlines into account.

Strings prefixed with x are shell expanded1.27.0:

foobar := x'~/$FOO/${BAR}'
ValueReplacement
$VARvalue of environment variable VAR
${VAR}value of environment variable VAR
${VAR:-DEFAULT}value of environment variable VAR, or DEFAULT if VAR is not set
Leading ~path to current user’s home directory
Leading ~USERpath to USER’s home directory

This expansion is performed at compile time, so variables from .env files and exported just variables cannot be used. However, this allows shell expanded strings to be used in places like settings and import paths, which cannot depend on just variables and .env files.