smbclient.exp

来自「samba-3.0.22.tar.gz 编译smb服务器的源码」· EXP 代码 · 共 55 行

EXP
55
字号
## Utilities for driving smbclient## Variablesset smb_prompt "smb: \\\\>"# Spawn smbclient and wait for a promptproc spawn_smbclient { args } {    set result 0    global smb_prompt    global spawn_id    # Spawn smbclient    spawn smbclient [lindex $args 0] [lindex $args 1] [lindex $args 2] \	    [lindex $args 3] [lindex $args 4] [lindex $args 5] \	    [lindex $args 6]    # Wait for prompt    expect {	$smb_prompt   { set result 1 }	timeout       { perror "timed out spawning smbclient" }	eof           { perror "end of file spawning smbclient" }    }    return $result}# Run a command and wait for a promptproc do_smbclient { args } {    set action [lindex $args 0]    set description [lindex $args 1]    global smb_prompt    # Send command    verbose $action    send $action    expect {	$smb_prompt     {}	timeout         { perror "timed out $description"; return -1}	eof             { perror "end of file $description"; return -1 }    }    verbose $expect_out(buffer)    return $expect_out(buffer)}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?