MS Recorder: Replace common code by function call
@@ -50,12 +50,12 @@ writeBlock()
if [ ! -z "$OUTBUF" ];
then
tmp=$(replace_newline_return <<< "$OUTBUF")
- tmp=$(echo "$tmp" | sed 's/\[/\\\[/g' | sed 's/\]/\\\]/g' | sed 's/\./\\\./g' | sed 's/\*/\\\*/g' | sed 's/\?/\\\?/g')
+ tmp=$(echo "$tmp" | regex_escape)
echo "STDOUT: $tmp" >> "$TMPFILE"
elif [ ! -z "$STDOUT" ];
then
tmp=$(replace_newline_return <<< "$STDOUT")
- tmp=$(echo "$tmp" | sed 's/\[/\\\[/g' | sed 's/\]/\\\]/g' | sed 's/\./\\\./g' | sed 's/\*/\\\*/g' | sed 's/\?/\\\?/g')
+ tmp=$(echo "$tmp" | regex_escape)
echo "STDOUT: $tmp" >> "$TMPFILE"
else
if [ ! -z "$STDOUTRE" ]
