Well, the variable is not boolean until it has been set to
So when the script begins, it checks for a boolean that was not set yet as in
bTest=''. So if I do this:
if $bTest;then echo "is active";fi it will output "is active" when I would like it to show nothing...
I could use this:
[ "$bTest" == true ], when before was just
$bTest, but to me that is the problem, it is not a "boolean", it is a string comparison...
Also, if I misstype a boolean variable name, it will be empty, and the script execution will throw no error message... and for several times I discovered the real problem was just the misstyped variable... Could an IDE have get that? I use
gedit so I must track my failures by myself.
I wonder if is there a clean and simple way to work with booleans instead of typing
[ "$bTest" == true ] every time..?