🔴 The rest of answers are highly slow, because of comparing values.
Justway with the storehighest performance in theis by checking if a variable the right boolean commandis empty or not:
#true:
condition="true"
#false:
condition="false"
Then run it as a command. For example:
# echo resultcondition=""
if "${condition}"; then
echo "yes"
else#true:
echo "no"condition=x
fi
#check:
#[[ exit-n status
"${condition}" ]]