This commit is contained in:
Marc Beninca 2024-06-08 12:05:37 +02:00
parent 6a93b10cf8
commit be0f461304
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

15
cd.sh
View file

@ -713,13 +713,14 @@ ${CD___UP}"
}
cd_write () {
local file="${1}"
local text="${2}"
if [ "${file}" ] ; then
[ -f "${file}" ] && cd_cat "${file}"
echo "${1}"
printf "%s" "${text}" > "${file}" || exit
cd_cat "${file}"
cd_write__file="${1}"
cd_write__text="${2}"
#
if [ "${cd_write__file}" ] ; then
[ -f "${cd_write__file}" ] && cd_cat "${cd_write__file}"
echo "${cd_write__file}"
printf "%s" "${cd_write__text}" > "${cd_write__file}" || exit
cd_cat "${cd_write__file}"
fi
}