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 92 times
1
β.εηοιτ.βε
- 24,064
- 11
- 54
- 67
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.
β.εηοιτ.βε
- 24,064
- 11
- 54
- 67