SHOW:
|
|
- or go back to the newest paste.
1 | - | #!/bin/bash |
1 | + | #!/usr/bin/expect -f |
2 | - | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
2 | + | |
3 | ||
4 | - | WGET=` which wget ` |
4 | + | # connect via scp |
5 | - | SED=` which sed ` |
5 | + | spawn scp [lindex $argv 0] [lindex $argv 1] |
6 | - | RM=` which rm ` |
6 | + | ####################### |
7 | - | CAT=` which cat ` |
7 | + | expect { |
8 | - | COPY=` which cp ` |
8 | + | -re ".*es.*o.*" { |
9 | - | GREP=` which grep ` |
9 | + | exp_send "yes\r" |
10 | - | AWK=` which awk ` |
10 | + | exp_continue |
11 | - | UNZIP=` which unzip ` |
11 | + | |
12 | - | ZIP=` which zip ` |
12 | + | -re ".*sword.*" { |
13 | - | MOVE=` which mv ` |
13 | + | exp_send "mypassword\r" |
14 | } | |
15 | - | download-data-zip() |
15 | + | |
16 | - | { |
16 | + | interact |