py-regex-replace/test/test_multiline_replacement.sh

22 lines
374 B
Bash
Executable File

#!/usr/bin/env sh
string='alpha = a
beta = b
Exec = foo bar baz
end = EOF'
pattern='foo bar baz'
repl='foo bar baz\n\n o.O\n'
string="$(printf '%s' "${string}" | ../src/py_regex_replace/main.py -p "${pattern}" -r "${repl}" -c 1)"
printf 'RESULT>>>\n%s\n<<<RESULT\n' "${string}"
# RESULT>>>
# alpha = a
# beta = b
# Exec = foo bar baz
#
# o.O
#
# end = EOF
# <<<RESULT