diff --git a/sh/util.sh b/sh/util.sh index 4dd81bf..cbcd67a 100644 --- a/sh/util.sh +++ b/sh/util.sh @@ -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() { local file="${1}" local text="${2}"