diff options
author | Jameson Rollins <jrollins@finestructure.net> | 2010-10-29 22:07:53 -0400 |
---|---|---|
committer | Jameson Rollins <jrollins@finestructure.net> | 2010-10-30 00:06:59 -0400 |
commit | 5b32da0412bf995b162cb42cefc5a5a392bdb009 (patch) | |
tree | 312f1e11da5c67e366ad8e5db80b29b6a58cdf04 | |
parent | 8019e159c585f0374bccac08f247830ac84ad2d4 (diff) |
catch return for grep in remove_line, for case where grep -v returns nothing (e.g. only line in file is removed)
-rw-r--r-- | src/share/common | 2 |
1 files changed, 1 insertions, 1 deletions
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 } |