Misc

How to write a multi-line string with YAML? What use cases is it good for?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

someMultiLineString: |
  look mama
  I can write a multi-line string
  I love YAML

It's good for use cases like writing a shell script where each line of the script is a different command.