标签: ansible command slash
我有以下代码。
- name: edit file command: "sed -i '{{item}}' file.txt" with_items: - /0,/^\s*$/d
在运行sed命令时,它在{{item}}值中使用双斜杠。 下面是命令说明。
{{item}}
sed -i '/0,/^\\s*$/d' file.txt
我不想在^\\s处使用双斜杠,我只需要像^\s这样的单斜杠。 双斜杠给出了错误。
^\\s
^\s