cd_write
This commit is contained in:
parent
6a93b10cf8
commit
be0f461304
1 changed files with 8 additions and 7 deletions
15
cd.sh
15
cd.sh
|
@ -713,13 +713,14 @@ ${CD___UP}"
|
||||||
}
|
}
|
||||||
|
|
||||||
cd_write () {
|
cd_write () {
|
||||||
local file="${1}"
|
cd_write__file="${1}"
|
||||||
local text="${2}"
|
cd_write__text="${2}"
|
||||||
if [ "${file}" ] ; then
|
#
|
||||||
[ -f "${file}" ] && cd_cat "${file}"
|
if [ "${cd_write__file}" ] ; then
|
||||||
echo "→ ${1}"
|
[ -f "${cd_write__file}" ] && cd_cat "${cd_write__file}"
|
||||||
printf "%s" "${text}" > "${file}" || exit
|
echo "→ ${cd_write__file}"
|
||||||
cd_cat "${file}"
|
printf "%s" "${cd_write__text}" > "${cd_write__file}" || exit
|
||||||
|
cd_cat "${cd_write__file}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue