rwx/sh/file.sh

27 lines
425 B
Bash
Raw Normal View History

2025-06-28 04:36:16 +02:00
# ╭──────╮
# │ 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
}