uci_load() { local PACKAGE="$1" # <- THIS LINE IS MISSING.. surely caller is not supposed to set it. config_load "$PACKAGE" local PACKAGE_BASE="$(basename "$PACKAGE")" [ -f "/tmp/.uci/${PACKAGE_BASE}" ] && { . "/tmp/.uci/${PACKAGE_BASE}" config_cb } } .... Note how uci_load is used by other funcs, i.e. uci_set: uci_load "$PACKAGE" ....