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.
Asked
Active
Viewed 247 times
1

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

redantshoes
- 11
- 2
1 Answers
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