I tried the code in this SO post - How to evaluate a boolean variable in an if block in bash? and it does not work. It looks like there are no booleans in BASH. Is there a flawless workaround which lets me set and check booleans in BASH ?
My code -
#!/bin/bash
flag=true
if [ $flag ]
echo 'True'
#flag=false
#echo 'Now changed to false'
fi
Even if flag=false in line 2, output is still True. Why ?