Skip to content

Instantly share code, notes, and snippets.

@arttuladhar
Created May 31, 2013 18:54
Show Gist options
  • Save arttuladhar/5687113 to your computer and use it in GitHub Desktop.
Save arttuladhar/5687113 to your computer and use it in GitHub Desktop.
Using Expect Script
#!/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