I wrote the below code and try to execute it. But i face the \"invalid command name \"do\" while executing do {\"
code:
#!/usr/bin/expect set val 0;
The short answer is no.
The slightly longer answer is:
while true { puts "\nval = $val" incr val if {[incr input -1] == 0} break }
The full discussion can be found on the Tcl wiki.