AK2: add remove_section, update documentation with note regarding escapes
This commit is contained in:
1 parent
8c64041208
commit
65520217ef
2 files changed
+8
No files matched your search
@@ -115,6 +115,11 @@ replace_section() {
|
||||
sed -i "${line}s;^;${4}\n;" $1;
|
||||
}
|
||||
|
||||
# remove_section <file> <begin search string> <end search string>
|
||||
remove_section() {
|
||||
sed -i "/${2}/,/${3}/d" $1;
|
||||
}
|
||||
|
||||
# insert_line <file> <if search string> <before|after> <line match string> <inserted line>
|
||||
insert_line() {
|
||||
if [ -z "$(grep "$2" $1)" ]; then
|
||||
|
||||
Reference in new issue
Block a user