期望无法编译正则表达式模式:

时间:2016-04-11 23:51:46

标签: expect

我正在期待Jenkins的工作,它给出了下面提到的错误。 不确定代码中有什么问题,我很期待。感谢帮助!

错误讯息:

send: sending "date\r" to { exp3 }
couldn't compile regular expression pattern: quantifier operand invalid
while executing
"expect -re "*2016*" "send_user ""

期待代码:

   #!/usr/local/bin/expect
    exp_internal 1
    set timeout 20
    spawn ssh USER_ID@Server_ID
    expect "*assword:" {send "password\\r"}
    expect -re "Login (incorrect|invalid)" {send_user "\nlogin failed\n" }
    expect -re "Last login:*" {send_user "\nlogin successful\n" }
    send "cd some_directory\\r"
    send "pwd\\r"
    expect -re "some_directory" {send_user "\n-->location verified\n"}
    send "date\\r" 
    expect -re "*2016*" {send_user "\ndate verified\n"}

0 个答案:

没有答案