This commit is contained in:
Marc Beninca 2024-06-08 12:32:21 +02:00
parent 99af49e1a8
commit 1100cf4234
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

14
cd.sh
View file

@ -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 #
cd_cat "${file}" if [ -f "${cd_sed__file}" ] ; then
for expression in "${@}" ; do cd_cat "${cd_sed__file}"
sed --in-place "s${expression}g" "${file}" \ for cd_sed__regex in "${@}" ; do
&& cd_cat "${file}" \ sed --in-place "s${cd_sed__regex}g" "${cd_sed__file}" \
&& cd_cat "${cd_sed__file}" \
|| exit || exit
done done
fi fi