cd_sed
This commit is contained in:
parent
99af49e1a8
commit
1100cf4234
1 changed files with 8 additions and 8 deletions
16
cd.sh
16
cd.sh
|
@ -686,14 +686,14 @@ local path="${1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
cd_sed () {
|
cd_sed () {
|
||||||
local expression
|
cd_sed__file="${1}"
|
||||||
local file="${1}"
|
shift
|
||||||
shift
|
#
|
||||||
if [ -f "${file}" ] ; then
|
if [ -f "${cd_sed__file}" ] ; then
|
||||||
cd_cat "${file}"
|
cd_cat "${cd_sed__file}"
|
||||||
for expression in "${@}" ; do
|
for cd_sed__regex in "${@}" ; do
|
||||||
sed --in-place "s${expression}g" "${file}" \
|
sed --in-place "s${cd_sed__regex}g" "${cd_sed__file}" \
|
||||||
&& cd_cat "${file}" \
|
&& cd_cat "${cd_sed__file}" \
|
||||||
|| exit
|
|| exit
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue