log_user 0 set timeout 6 # Verify the multi-line branch form parses and matches, plus clean EOF close. spawn /bin/cat send "TOK-42\r" set g1 0 expect { "TOK-42" { set g1 1 } timeout { } eof { } } puts "V-branch $g1" send "\004" expect eof catch {wait} puts "V-DONE"