From 482ba47dd9cf8b6660e8634f59251087e862513b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 1 Dec 2024 16:39:55 +0100 Subject: [PATCH] file/write --- sh/util.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sh/util.sh b/sh/util.sh index 7d9cc3f..a7956ef 100644 --- a/sh/util.sh +++ b/sh/util.sh @@ -1,3 +1,11 @@ +rwx_file_write() { + local file="${1}" + local text="${2}" + if [ -n "${file}" ]; then + printf "%s" "${text}" > "${file}" + fi +} + rwx_list_block_devices() { lsblk \ --noempty \