make local variables local

.. to not interfere with variables in the scripts that source these utils.
This commit is contained in:
root
2025-02-03 11:12:05 +01:00
parent 204162a747
commit 4c60127786
5 changed files with 18 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/bash
isarray() {
var=$1
local var=$1
declare -p $1 2> /dev/null | grep -q '^declare \-a' && return 0
[[ ${var[0]} -eq ${var[0]} ]] && [[ ${var[1]} -eq ${var[1]} ]] && return 0 || return 1
}