some basic helpers

This commit is contained in:
2025-01-16 14:23:19 +08:00
parent 5d3004c87b
commit 1e0d54f5d6

View File

@@ -85,3 +85,11 @@ cdownload() {
require curl
curl -fsSL "$1" -o "$2"
}
is_int() {
[[ "$1" =~ ^[0-9]+$ ]]
}
is_number() {
[[ "$1" =~ ^[0-9]+([.,][0-9]+)?$ ]]
}