Skip to content
Tcl Source Code Artifact [762940a08f]
Login

Artifact [762940a08f]

Artifact 762940a08f02dd458684aa6c073d1128d1a1111d:

Ticket change [762940a08f] - Ticket [30c5d37cfa0028c9|30c5d37cfa] <i>Expect eof occurring before end of output from spawned process</i> status still Open with 3 other changes by tld on 2013-08-12 14:46:25.
D 2013-08-12T14:46:25.924
J icomment Below\sI've\spasted\sa\sTcl\sscript\sthat\sreproduces\sthe\sissue.\s\sWhile\sit's\snot\san\sexpect\sscript,\sit's\sstill\susing\sthe\sExpect\spackage.\s\sI'm\snot\sactually\sclear\sas\sto\show\sto\seven\stry\sa\ssimilar\stest\swith\sno\sinvolvement\sof\sExpect\sat\sall,\sas\sthis\sseems\sto\sbe\srelated\sto\sthe\sEOF\sfrom\sa\sspawned\sexternal\sprocess.\s\sIs\sthat\seven\sdoable\sin\sTcl\swith\sanything\sother\sthan\sspawn/expect?\r\n\r\nAnyway,\shere's\sa\sTcl\sscript\sversion\sof\sthe\sabove\stest,\swhich\sagain,\sduplicated\sthe\sissue\susing\s"tclsh\stest.tcl\s>\sout.txt":\r\n\r\npackage\srequire\sExpect\r\nset\stimeout\s30\r\n\r\nproc\sexitspawnstat\sargs\s{\r\n\s\s\scatch\swait\sresult\r\n\s\s\sset\srtn\s[lindex\s$result\s2]\r\n\s\s\sif\s{\s!$rtn\s}\s{\r\n\s\s\s\s\s\sset\srtn\s[lindex\s$result\s3]\r\n\s\s\s}\r\n\s\s\sexit\s$rtn\r\n}\r\n\r\nexp_log_user\s1\r\nspawn\s-noecho\scat\s./in.txt\r\nexpect\s{\r\n\teof\s{\r\n\t\texitspawnstat\r\n\t}\r\n\ttimeout\s{\r\n\t\texp_log_user\s1\r\n\t\texp_send_user\s"Timeout.\\n"\r\n\t\texit\s253\r\n\t}\r\n\t-nocase\s-re\s"password:"\s{\s\r\n\t\texp_continue\r\n\t}\r\n\t"(yes/no)?\s"\s{\s\r\n\t\texp_continue\r\n\t}\r\n\t-nocase\s-re\s"Enter\spassphrase"\s{\r\n\t\texp_continue\r\n\t}\r\n\t"testing-sudo-passwd:"\s{\r\n\t\texp_continue\r\n\t}\r\n}
J login tld
J mimetype text/plain
K 30c5d37cfa0028c9ef83fa9efc490f4bc28b64ff
U tld
Z f4148d99987988f1840196ea8af0e4b9