I am trying to compare two numbers in bash, but I want it to be in a function and then return with Passed or Failed
So far I have this
myfunc(){
if ["$val1" -eq "$val2"]; then
echo "Passed"
else
echo "Failed"
}
echo "$myfunc"
The desired output would be if i have val1 = 2 and val2 = 2, they are equal thus it will return
Passed