as noted by @tripleee, this is tangential, at best.
still, in case you arrived here searching for something like that (as i did), here is my solution
having to deal with user acessible configuration files, i use this function :
function isTrue() {
if [[ "${@^^}" =~ ^(TRUE|OUI|Y|O$|ON$|[1-9]) ]]; then return 0;fi
return 1
}
wich can be used like that
if isTrue "$whatever"; then..
You can alter the "truth list" in the regexp, the one in this sample is french compatible and considers strings like "Yeah, yup, on,1, Oui,y,true to be "True".
note that the '^^' provides case insensivity