py-regex-replace/test/test1.sh

13 lines
287 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}"