% set HI 1
1
% if { [ info exists HI] && { $HI == 1 } } { puts "Hello World "}
can't use non-numeric string as operand of "&&"
%
Either of the conditions can be tested alone. How to make the && of the tests work in TCL?
This alone works
% if { $HI == 1 } { puts "Hello World "}
Hello World
And this works alone too.
% if { [ info exists HI] } { puts "Hello World "}
Hello World
You don’t need the extra curly braces; this should work fine: