py-regex-replace/test/test1.sh
2022-06-23 14:50:49 +02:00

13 lines
269 B
Bash

#!/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/main.py -p "${pattern}" -r "${repl}" -c 1)"
printf 'RESULT>>>\n%s\n<<<RESULT\n' "${string}"