file/append,empty

This commit is contained in:
Marc Beninca 2024-12-01 23:40:54 +01:00
parent 9f705e6af8
commit ce872d4ecb
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -1,3 +1,18 @@
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() { rwx_file_write() {
local file="${1}" local file="${1}"
local text="${2}" local text="${2}"