I am needing to include some if statements within an expect script. These will need to have two conditions under an AND join. Upon a successful IF condition I want to set multiple variables.
I have tried a lot of variations of the below statement with no success. I have also searched the WEB with every possible combination to attempt to find the answer.
Does anyone know of what I am missing to make this work?
Variant 1 -
if { $user = "USER1" -a $mode = "PROD" } {
set port "224"; set remote "PROD"; set archive "local;}
Variant 2
if [ $user = "USER1" -a $mode = "PROD" ]; then
set port "224"
set remote "PROD"
set archive "local
fi
One could Google for tcl if statement syntax. Then something like this might show up:
#!/usr/bin/env tclsh
# @(#) tcl1 Demonstrate tclsh feature.
set version [ info tclversion ]
set message " Hello, world, tcl version ($version).\n"
puts stdout $message
puts "Hey dude, how old might you be?"
gets stdin Age
if {$Age >= 0 && $Age <= 12} {
puts "You are a child."
} elseif {$Age >= 13 && $Age <= 19} {
puts "You are a teen."
} elseif {$Age > 19} {
puts "You are an adult now."
}
producing:
% ./tcl1
Hello, world, tcl version (8.4).
Hey dude, how old might you be?
15
You are a teen.