except 使用(一) [ suosuo ]

撰写于 2016-10-28
修改于 2016-11-09
分类
技能


Tag
Linux

建立这个博客的第二天

  • 其实今天还是在日常上班,现在是晚上九点差一刻。
  • 腰椎有些刺痛
  • 学习了使用EXCEPT软件自动与服务器进行交互

下面放上今天使用的代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
set timeout 20
set host 0.0.0.0
set username xxxx
set password xxxx
set src_file [lindex $argv 0]
set dest_file [lindex $argv 1]
spawn scp -r $src_file $username@$host:$dest_file
expect {
"(yes/no)?"
{
send "yesn"
expect "password:" { send "$passwordn"}
}
"password:"
{
send "$passwordn"
}
}
expect "100%"
expect eof