I want to store the result of a bash string comparison in a variable, with effect equivalent to:
if [[ $a == $b ]]; then
res=1
else
res=0
fi
I was hoping to be able to write something terser, like:
res2=$('$a'=='$b') #Not valid bash
Is there a way to achieve what I want, without deferring to an if construct?