27 lines
425 B
Bash
27 lines
425 B
Bash
|
# ╭──────╮
|
||
|
# │ file │
|
||
|
# ╰──────╯
|
||
|
|
||
|
rwx_file_append() {
|
||
|
local file="${1}"
|
||
|
local text="${2}"
|
||
|
if [ -n "${file}" ]; then
|
||
|
printf "%s" "${text}" >>"${file}"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
rwx_file_empty() {
|
||
|
local file="${1}"
|
||
|
if [ -n "${file}" ]; then
|
||
|
rwx_file_write "${file}" ""
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
rwx_file_write() {
|
||
|
local file="${1}"
|
||
|
local text="${2}"
|
||
|
if [ -n "${file}" ]; then
|
||
|
printf "%s" "${text}" >"${file}"
|
||
|
fi
|
||
|
}
|