cd_sed
This commit is contained in:
parent
1f8d5b0a86
commit
ae496a66af
1 changed files with 8 additions and 7 deletions
15
cd.sh
15
cd.sh
|
@ -620,14 +620,15 @@ cd_rm () {
|
||||||
|
|
||||||
cd_sed () {
|
cd_sed () {
|
||||||
local expression
|
local expression
|
||||||
local file
|
local file="${1}"
|
||||||
if [ -f "${1}" ] ; then
|
shift
|
||||||
file="${1}"
|
if [ -f "${file}" ] ; then
|
||||||
shift
|
|
||||||
for expression in "${@}" ; do
|
|
||||||
sed --in-place "s${expression}g" "${file}" || exit
|
|
||||||
done
|
|
||||||
cd_cat "${file}"
|
cd_cat "${file}"
|
||||||
|
for expression in "${@}" ; do
|
||||||
|
sed --in-place "s${expression}g" "${file}" \
|
||||||
|
&& cd_cat "${file}" \
|
||||||
|
|| exit
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue