py-regex-replace/test/test.sh
2023-03-16 18:17:45 +01:00

13 lines
287 B
Bash
Executable File

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