Hello,
I've been racking my brain trying to find a good way to accomplish a task. I need to insert a block of text into a file in the format of
FirewallRuleSet proxy-users {
FirewallRule allow to 0.0.0.0/0
}
I need to insert this block of text (which could have sed special characters) into a file under another block of text of a similar format:
FirewallRuleSet known-users {
FirewallRule allow to 0.0.0.0/0
}
The issue is to get it to insert AFTER the closing } bracket. I've tried a few different options like sed with a ranged select; sed -i '/^FirewallRuleSet known-users.*/,/^}$/a \ $BLOB' .
But that obviously isn't valid syntax. So my question is, is there a method to accomplish this? The problem is it's also in the middle of a file and never at the same line.