_/cat
This commit is contained in:
parent
3d64af5378
commit
e6dcf63631
1 changed files with 5 additions and 5 deletions
|
@ -178,7 +178,7 @@ _spcd_frame_shut() {
|
||||||
# │ internal │ os │
|
# │ internal │ os │
|
||||||
# ╰──────────┴────╯
|
# ╰──────────┴────╯
|
||||||
|
|
||||||
spcd_os_cat() {
|
_spcd_os_cat() {
|
||||||
spcd_cat__file="${1}"
|
spcd_cat__file="${1}"
|
||||||
if [ -n "${spcd_cat__file}" ]; then
|
if [ -n "${spcd_cat__file}" ]; then
|
||||||
_spcd_frame_open "${spcd_cat__file}"
|
_spcd_frame_open "${spcd_cat__file}"
|
||||||
|
@ -313,10 +313,10 @@ spcd_os_sed() {
|
||||||
spcd_os_sed__file="${1}"
|
spcd_os_sed__file="${1}"
|
||||||
shift
|
shift
|
||||||
if [ -f "${spcd_os_sed__file}" ]; then
|
if [ -f "${spcd_os_sed__file}" ]; then
|
||||||
spcd_os_cat "${spcd_os_sed__file}"
|
_spcd_os_cat "${spcd_os_sed__file}"
|
||||||
for spcd_os_sed__regex in "${@}"; do
|
for spcd_os_sed__regex in "${@}"; do
|
||||||
sed --in-place "s${spcd_os_sed__regex}g" "${spcd_os_sed__file}" &&
|
sed --in-place "s${spcd_os_sed__regex}g" "${spcd_os_sed__file}" &&
|
||||||
spcd_os_cat "${spcd_os_sed__file}"
|
_spcd_os_cat "${spcd_os_sed__file}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -326,10 +326,10 @@ spcd_os_write() {
|
||||||
spcd_os_write__text="${2}"
|
spcd_os_write__text="${2}"
|
||||||
if [ -n "${spcd_os_write__file}" ]; then
|
if [ -n "${spcd_os_write__file}" ]; then
|
||||||
[ -f "${spcd_os_write__file}" ] &&
|
[ -f "${spcd_os_write__file}" ] &&
|
||||||
spcd_os_cat "${spcd_os_write__file}"
|
_spcd_os_cat "${spcd_os_write__file}"
|
||||||
echo "→ ${spcd_os_write__file}"
|
echo "→ ${spcd_os_write__file}"
|
||||||
printf "%s" "${spcd_os_write__text}" >"${spcd_os_write__file}"
|
printf "%s" "${spcd_os_write__text}" >"${spcd_os_write__file}"
|
||||||
spcd_os_cat "${spcd_os_write__file}"
|
_spcd_os_cat "${spcd_os_write__file}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue