This commit is contained in:
Marc Beninca 2025-06-28 04:36:16 +02:00
parent 1cad82456e
commit 88f3ab499d
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
4 changed files with 39 additions and 24 deletions

26
sh/file.sh Normal file
View file

@ -0,0 +1,26 @@
# ╭──────╮
# │ 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
}