catch return for grep in remove_line, for case where grep -v returns nothing (e.g...
authorJameson Rollins <jrollins@finestructure.net>
Sat, 30 Oct 2010 02:07:53 +0000 (22:07 -0400)
committerJameson Rollins <jrollins@finestructure.net>
Sat, 30 Oct 2010 04:06:59 +0000 (00:06 -0400)
src/share/common

index 025c991396bb4bb3f9fe619d586223b423a64b9d..1e393c78dd73f73ca0a5138f36c841d50bef1750 100644 (file)
@@ -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
 }