I have multiple variables in an array, I want to loop through each of those variables and find if they are empty.
Code:
declare -a CONFIG_PARAM=( $Var_MODE $Var_Path $Var_Stage $Var_line $Var_CVG $Var_Operator )
for PARAMS in "${CONFIG_PARAM[@]}"; do
if [ ! $PARAMS ]; then
echo -e "$PARAMS is empty"
fi
done;
But it doesnt seem to catch the empty variables. Can someone point out what is wrong or provide any suggestion/solution? Thanks in advance for any help.
"$Var_MODE" "$Var_PATH"etc. And[ ! "$PARAMS" ]