diff --git a/mutation-testing/scripts/sed-script.sh b/mutation-testing/scripts/sed-script.sh new file mode 100644 index 0000000000..b6c05e1c36 --- /dev/null +++ b/mutation-testing/scripts/sed-script.sh @@ -0,0 +1,14 @@ + +FILE="../packages-output/stx-genesis/caught.txt" + +var_1="stx-genesis/src/lib.rs" +var_2="replace ::next -> Option with Some(Default::default())" + +# Escape the variables for use in a sed pattern +escaped_var_1=$(echo "$var_1" | sed -E 's/([][\/$*.^|])/\\&/g') +escaped_var_2=$(echo "$var_2" | sed -E 's/([][\/$*.^|])/\\&/g') + +# Use sed to remove lines matching the pattern +sed "/$escaped_var_1:[0-9]+:$escaped_var_2/d" "$FILE" > "$FILE" +# :[0-9]+: +# sed -i "/$regex/d" "$FILE"