os/sed
This commit is contained in:
parent
e0552167bf
commit
6f3c5a8143
1 changed files with 7 additions and 6 deletions
|
@ -260,13 +260,14 @@ spcd_os_rm() {
|
|||
}
|
||||
|
||||
spcd_os_sed() {
|
||||
spcd_os_sed__file="${1}"
|
||||
local file="${1}"
|
||||
shift
|
||||
if [ -f "${spcd_os_sed__file}" ]; then
|
||||
_spcd_os_cat "${spcd_os_sed__file}"
|
||||
for spcd_os_sed__regex in "${@}"; do
|
||||
sed --in-place "s${spcd_os_sed__regex}g" "${spcd_os_sed__file}" &&
|
||||
_spcd_os_cat "${spcd_os_sed__file}"
|
||||
if [ -f "${file}" ]; then
|
||||
local regex
|
||||
_spcd_os_cat "${file}"
|
||||
for regex in "${@}"; do
|
||||
sed --in-place "s${regex}g" "${file}" &&
|
||||
_spcd_os_cat "${file}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue