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 () {
|
||||
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue