py-regex-replace/test/test_multiline_pattern.sh

17 lines
320 B
Bash
Raw Normal View History

2022-06-23 14:50:49 +02:00
#!/usr/bin/env sh
string='alpha = a
beta = b
Exec = foo bar baz
end = EOF'
2023-03-20 19:54:46 +01:00
pattern='= b\nExec = .*\nend ='
2022-10-17 22:02:36 +02:00
repl='='
2022-06-23 14:50:49 +02:00
2022-06-23 23:35:19 +02:00
string="$(printf '%s' "${string}" | ../src/py_regex_replace/main.py -p "${pattern}" -r "${repl}" -c 1)"
2022-06-23 14:50:49 +02:00
printf 'RESULT>>>\n%s\n<<<RESULT\n' "${string}"
2023-03-20 19:54:46 +01:00
# RESULT>>>
# alpha = a
# beta = EOF
# <<<RESULT