use expect to input password automatically
2013-02-21 11:51
183 查看
#!/usr/local/bin/expect -f
puts $argv
set fl [lindex $argv 0]
set pw [lindex $argv 1]
spawn scp $fl $REMOET_SERVER:$PATH
expect "*password:"
#following $pw is carriage return
send "$pw
"
expect eof
puts $argv
set fl [lindex $argv 0]
set pw [lindex $argv 1]
spawn scp $fl $REMOET_SERVER:$PATH
expect "*password:"
#following $pw is carriage return
send "$pw
"
expect eof
相关文章推荐
- How to Use Password Fields(密码框的使用)
- SSH login expect shell script to supply username and password
- [Python] Use Python to generate Java Unit Test codes automatically
- Use a TL431 shunt regulator to limit high ac input voltage
- [Ubuntu] Simple method to login SSH without insert user name and password via expect in linux
- use WLST to create weblogic domain automatically
- Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state
- How to use gnu readline to implement "reset password".
- Use Perl to check Purify result automatically
- How to use HttpSendRequestEx with password-protected URLs
- Use bubble sort to sort the input intergers
- android:password is deprecated: Use inputType instead
- How to use the CONVERSION_EXIT_PARVW_INPUT and CONVERSION_EXIT_PARVW_OUTPUT
- (转)How to use HttpSendRequestEx with password-protected URLs
- To select the file to upload we can use the standard HTML input control of type
- android:password is deprecated: Use inputType instead
- [PReact] Use Link State to Automatically Handle State Changes
- [Angular] Learn How To Use ng-template Inputs
- Use mdev to automatically generate the device node
- How to use bindings-generator to generate lua binding automatically