My thought is that this would remove every line before ‘[sssd]’. But instead it pretty much deletes the whole file. I have a workaround using sed via the command module. But I’d like to use replace or lineinfile. Any ideas? I also figured I could use a loop of regexps. Just seem like this should be simple. Heck the sed is simple for this.
My thought is that this would remove every line before '[sssd]'.
The before is also regexp so you need to escape the too.
If you do that it will delete everything from the start of the file to the [sssd]
But instead it pretty much deletes the whole file.
Since it can't find [sssd] because of the missing escape it will remove the content of every line.
I have a workaround using
sed via the command module. But I'd like to use replace or lineinfile. Any
ideas? I also figured I could use a loop of regexps. Just seem like this
should be simple. Heck the sed is simple for this.
sed -i '/^\[domain\/example\]/,/^$/d' /etc/sssd/sssd.conf
Nice. I new I was missing something. I went with the second option. It replaced all the text with a blank line. The former left a blank line for each match.