Add .inc extension to libs

This commit is contained in:
2021-07-28 00:27:40 +02:00
parent b7a11fc4ee
commit 2573380c21
4 changed files with 0 additions and 0 deletions

16
bashutils.inc Normal file
View File

@@ -0,0 +1,16 @@
#!/hint/bash
function shasum {
command shasum <<<"$1" | awk '{ print $1 }'
}
# once <command>
function once {
local flagname="__onceflag_$(shasum "$*")"
if [[ -z ${!flagname} ]]; then
declare -g "${flagname}"=1
"$@"
fi
}