79549427

Date: 2025-04-02 00:47:43
Score: 2.5
Natty:
Report link

What can I do to fix this?

Refactor your idea to write it in a single performant programming language. Bash is a shell - it executes other programs. Each program takes time to start.

You could generate sed script in one go and then execute it. Note that this will not handle ^hello or any other . * [ ? \ characters correctly, as sed works with regex. ^ matches beginning of a line.

sed "$(sed 's/\([^=]*\)=\(.*\)/s`\1\\b`\2`g/g' "$PROPERTIES_FILE")" "$INPUT_FILE"
echo "$INPUT"

You could escape the special characters with something along like this. See also https://stackoverflow.com/a/2705678/9072753 .

sed "$(sed 's/[]\/$*.^&[]/\\&/g; s/\([^=]*\)=\(.*\)/s`\1\\b`\2`g/g; ' "$PROPERTIES_FILE")" "$INPUT_FILE"

Notes: use shellcheck. Use $(...) instead of backticks. Do not abuse cats - just use <file instead of <<<$(cat "$PROPERTIES_FILE"). Don't SCREAM - consider lowercase variables.

Reasons:
  • Blacklisted phrase (1): can I do
  • Blacklisted phrase (1): stackoverflow
  • Blacklisted phrase (1): What can I do
  • RegEx Blacklisted phrase (1.5): fix this?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): What can I
  • High reputation (-2):
Posted by: KamilCuk