i made a function to parse my array. i've to send back two variable -"$y" there is a match -"$value" the name of the value
i dont understand why he dont want to initialize my res variable to y ?
function contains() {
local n=$#
local value=${!n}
for ((i=1;i < $#;i++)) {
if [ "${!i}" == "${value}" ]; then
res= "y"
echo "value of y : $res"
echo "$res|$value"
return 0
fi
}
echo "no match found function"
return 1
}
++ '[' 2017-11-16 == 2017-11-16 ']'
++ res=
++ y
./connectOracle.sh: line 53: y: command not found
++ echo 'value y : '