Variables and Substitution

Variables, strings, concatenation, path joining, and substitution using {{…}} are supported:

tmpdir  := `mktemp -d`
version := "0.2.7"
tardir  := tmpdir / "awesomesauce-" + version
tarball := tardir + ".tar.gz"

  rm -f {{tarball}}
  mkdir {{tardir}}
  cp *.c {{tardir}}
  tar zcvf {{tarball}} {{tardir}}
  scp {{tarball}}
  rm -rf {{tarball}} {{tardir}}

Joining Paths

The / operator can be used to join two strings with a slash:

foo := "a" / "b"
$ just --evaluate foo

Note that a / is added even if one is already present:

foo := "a/"
bar := foo / "b"
$ just --evaluate bar

Absolute paths can also be constructed1.5.0:

foo := / "b"
$ just --evaluate foo

The / operator uses the / character, even on Windows. Thus, using the / operator should be avoided with paths that use universal naming convention (UNC), i.e., those that start with \?, since forward slashes are not supported with UNC paths.

Escaping {{

To write a recipe containing {{, use {{{{:

  echo 'I {{{{LOVE}} curly braces!'

(An unmatched }} is ignored, so it doesn’t need to be escaped.)

Another option is to put all the text you’d like to escape inside of an interpolation:

  echo '{{'I {{LOVE}} curly braces!'}}'

Yet another option is to use {{ "{{" }}:

  echo 'I {{ "{{" }}LOVE}} curly braces!'