Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

expect globals

Status
Not open for further replies.

AHinMaine

ISP
Nov 27, 2002
264
US
can someone tell me why this:

> cat test.exp
Code:
#!/usr/local/bin/expect -f

global testvar
set testvar "foo"

proc testproc {} {
                send_user "var=$testvar"
}

testproc

gets this output?

> ./test.exp
Code:
can't read "testvar": no such variable
    while executing
"send_user "var=$testvar""
    (procedure "testproc" line 2)
    invoked from within
"testproc
"
    (file "./test.exp" line 10)
--
Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top