Skip to content

Instantly share code, notes, and snippets.

@anscii
Last active December 20, 2015 06:48
Show Gist options
  • Save anscii/6087995 to your computer and use it in GitHub Desktop.
Save anscii/6087995 to your computer and use it in GitHub Desktop.
Mass svn up with auto svn+ssh password input via expect
#!/bin/bash
for PROJECT in Proj1 Proj2
do
echo "##############"
echo "Starting ${PROJECT} update..."
cd /home/username/httpdocs/services/projects/${PROJECT}
expect <<- DONE
spawn svn up
expect {
"username@svn.domain.com's password:*" {
send -- "password\r"
exp_continue
}
eof {
exit 0}
}
send_user "success!\n"
DONE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment