Numeric Comparisons 101 - if: Error in example code
Open1801314fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-09-24 16:41:34
#
# A dangerous example: due to the extra round of substitution,
# the script stops
#
set y {[exit]}
if "$$y != 1" {
puts "$$y is != 1"
} else {
puts "$$y is 1"
}
[email protected]plain2007-09-24 23:42:52
Logged In: NO
I believe the dangerous line should read:
if "$y != 1" {
To cause the evaluation of exit after substitution.
Log in (anonymous is fine) to add a comment.