file/append,empty
This commit is contained in:
parent
9f705e6af8
commit
ce872d4ecb
1 changed files with 15 additions and 0 deletions
15
sh/util.sh
15
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() {
|
rwx_file_write() {
|
||||||
local file="${1}"
|
local file="${1}"
|
||||||
local text="${2}"
|
local text="${2}"
|
||||||
|
|
Loading…
Reference in a new issue