1

I'm trying to format a grep command like: grep -E "\b{{ansible-variable}}(\s|$)", but with both double quotes and back slashes, it's not working.

β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83

1 Answers1

1

The easiest for those cases is to use YAML multiline syntax.

 - command: >-
     grep -E "\b{{ansible_variable}}(\s|$)"
   vars:
     ansible_variable: foo

Also, a nice tool to play with its multiple forms can be found here.

β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83