in my bash script I did the following syntax in order to verify if $Val is boolean
if [[ $Val != True ]] && [[ $Val != False ]];then
echo "sorry but Val isn't a boolean"
exit 1
else
echo "good state $Val is a boolean"
fi
any other idea how to do it more elegant?
so if $Val is True
or False
, then its good state
if not then we do exit 1
when I use "[[ $Val != @(True|False) ]]"
,
then in my python charm editor I get: