file
This commit is contained in:
parent
1cad82456e
commit
88f3ab499d
4 changed files with 39 additions and 24 deletions
26
sh/file.sh
Normal file
26
sh/file.sh
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue