mirror of
https://codeberg.org/privacy1st/py-regex-replace
synced 2024-12-23 02:36:05 +01:00
19 lines
372 B
Bash
Executable File
19 lines
372 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}"
|
|
# RESULT>>>
|
|
# alpha = a
|
|
# beta = b
|
|
# Exec = /bin/foo BAR BAZ
|
|
# end = EOF
|
|
# <<<RESULT
|