- 论坛徽章:
- 0
|
本帖最后由 xiaopan3322 于 2010-11-17 20:43 编辑
回复 1# zhao3stones
用regexp(当然,也可以用string match)
- if {[regexp {NOTICE TO USERS} $parm]} {
- puts "successful"
- }
复制代码 把parm赋值就行了- #!/usr/bin/expect --
- set parm "sss,Inc. System\r\nAuthorized Personnel Only\r\n***************************************************************************\r\n
- NOTICE TO USERS\r\n\r\n\r\nThis is a commercial computer system and is the property of sss, Inc.\r\nIt is for authori
- zed use only. Users (authorized or unauthorized) have no\r\nexplicit or implicit expectation of privacy. Any or all uses of this system\r\nan
- d all files on this system may be intercepted, monitored, recorded,\r\ncopied, audited, inspected, and disclosed to authorized site, sss,Inc.
- ,\r\nand law enforcement personnel, as well as authorized officials of other\r\nagencies, both domestic and foreign. By using this system, th
- e user consents\r\nto such interception, monitoring, recording, copying, auditing, inspection,\r\nand disclosure at the discretion of sss,Inc
- personnel.\r\nUnauthorized or improper use of this system may result in administrative\r\ndisciplinary action and civil and criminal penalti
- es. By continuing to use\r\nthis system you indicate your awareness of and consent to these terms and\r\nconditions of use. LOG OFF IMMEDIATE
- LY if you do not agree to the conditions\r\nstated in this warning.\r\n\r\n\r\n**************************************************************
- ***************\r\n\r\n"
- #use regexp
- if {[regexp {NOTICE TO USERS} $parm]} {
- puts "successful"
- }
复制代码 |
|