I have the following scenario
Step1
local output=$(sshpass -p ${PSSWD} ssh -tt -oStrictHostKeyChecking=no root@$IP "$(< vXU-script.sh)")
step 2
mapfile -t RIU_ARRAY < <(echo "$output" | grep "RIU-[1-4] ----> ")
the above line will grep the following line
RIU-1 ----> AB019030015 ----> 223a:c03a:261:1141:0:50:c389:22ff
step 3 (loop RIU_ARRAY)
ip=$(echo "${item}" | awk -F" " '{print $5}')
The above line will get the IP part 223a:c03a:261:1141:0:50:c389:22ff
if [ "${ip}" == "223a:c03a:261:1141:0:50:c389:22ff" ]; then
echo "#### Same"
else
echo "#### Different"
fi
The above line is always False and the following line is printed #### Different
I expect it to be the same. Is this because of the semi-colon or CLI console greped character encoding issues?