2021-07-21 16:49:00 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#All common functions can be added to this file
|
|
|
|
|
|
|
|
is_gnu_sed () {
|
|
|
|
sed --version >/dev/null 2>&1
|
|
|
|
}
|
|
|
|
|
|
|
|
replace () {
|
2022-06-05 15:30:23 -04:00
|
|
|
echo "${1}"
|
2021-07-21 16:49:00 -04:00
|
|
|
if is_gnu_sed; then
|
2022-06-05 15:30:23 -04:00
|
|
|
sed -i -E "${1}" "${2}"
|
2021-07-21 16:49:00 -04:00
|
|
|
else
|
2022-06-05 15:30:23 -04:00
|
|
|
sed -i '' -E "${1}" "${2}"
|
2021-07-21 16:49:00 -04:00
|
|
|
fi
|
|
|
|
}
|