I'm learning bash script and I wrote something to better understand it. But below code really confuses me.
#!/bin/bash
ifEqual() {
if [ "$3"="$1" ] ; then
echo "$2=$1"
else
echo "heiheihei"
fi
}
ifEqual "111" "666"
When I call this .sh file, it will print "666=111". But the function doesn't even have a third parameter. I expect this code to print "heiheihei". Can anyone explain to me what's happening here? Thank you in advance!