Browse Source

fix append_or_replace

main
pvincent 9 months ago
parent
commit
057cdd4153
  1. 2
      tools/append_or_replace

2
tools/append_or_replace

@ -11,7 +11,7 @@ STRING=$2
FILE=$3 FILE=$3
if ! grep -Eq "$REGEX" "$FILE"; then if ! grep -Eq "$REGEX" "$FILE"; then
printf "%s\n" "$STRING" >>"$FILE"
builtin echo -e "$STRING" >>"$FILE"
echo 'appended' echo 'appended'
else else
sed -Ei "s|$REGEX|$STRING|g" "$FILE" sed -Ei "s|$REGEX|$STRING|g" "$FILE"

Loading…
Cancel
Save