From: Jameson Rollins Date: Sat, 30 Oct 2010 02:07:53 +0000 (-0400) Subject: catch return for grep in remove_line, for case where grep -v returns nothing (e.g... X-Git-Tag: monkeysphere_0.35-1~1^2~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5b32da0412bf995b162cb42cefc5a5a392bdb009;p=monkeysphere.git catch return for grep in remove_line, for case where grep -v returns nothing (e.g. only line in file is removed) --- diff --git a/src/share/common b/src/share/common index 025c991..1e393c7 100644 --- a/src/share/common +++ b/src/share/common @@ -346,7 +346,7 @@ remove_line() { log debug "removing matching key lines..." tempfile=$(mktemp "${file}.XXXXXXX") || \ failure "Unable to make temp file '${file}.XXXXXXX'" - grep -v -x -F "$lines" "$file" >"$tempfile" + grep -v -x -F "$lines" "$file" >"$tempfile" || : mv -f "$tempfile" "$file" fi }