Created
May 31, 2013 18:54
-
-
Save arttuladhar/5687113 to your computer and use it in GitHub Desktop.
Using Expect Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect | |
#Aayush Tuladhar | |
#Usage ./splunk_install.sh servername | |
#Setting Variable | |
set server [lrange $argv 0 0] | |
spawn scp file.txt splunk@$server:/home/asadmin/testfile.txt | |
expect { | |
-re "RSA key fingerprint" {send "yes\r"} | |
} | |
set pass "east" | |
expect { | |
-re "Password:" {send "$pass\r"} | |
} | |
expect eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment