AK2: add remove_section, update documentation with note regarding escapes

This commit is contained in:
osm0sis committed 2016-01-14 15:51:59 -04:00
1 parent 8c64041208
commit 65520217ef
2 files changed
+8

No files matched your search

+5
View File
@@ -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