diff --git a/cdist/conf/type/__line/gencode-remote b/cdist/conf/type/__line/gencode-remote
index fa051951..4a75b4c5 100755
--- a/cdist/conf/type/__line/gencode-remote
+++ b/cdist/conf/type/__line/gencode-remote
@@ -81,7 +81,7 @@ tmpfile=\$(mktemp ${file}.cdist.XXXXXXXXXX)
 if [ -f "$file" ]; then
    cp -p "$file" "\$tmpfile"
 fi
-grep -v $greparg '$regex' '$file' > \$tmpfile || true
+grep -v $greparg "$regex" '$file' > \$tmpfile || true
 mv -f "\$tmpfile" "$file"
 eof
         echo "removed" >> "$__messages_out"