py-regex-replace/test/test.sh

19 lines
372 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'
pattern='^Exec = foo .*$'
repl='Exec = /bin/foo BAR BAZ'
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 = b
# Exec = /bin/foo BAR BAZ
# end = EOF
# <<<RESULT