当用户名/密码在第一次尝试时正确但当我故意提供错误的用户名/密码时,下面的脚本工作正常。但是,如果提交因错误的凭据而失败,我如何让脚本再次提示用户名和密码?
#!/usr/bin/bash
read -p "Enter message: " svnmessage
read -p "Enter username: " username
read -s -p "Enter Password: " password
svn commit test.log -m "$svnmessage" --username $username --password $password --non-interactive
当我提供错误的用户名/密码时:
Enter message: some message
Enter username: wrong name
Enter Password:
svn: E170001: Commit failed (details follow):
svn: E170001: POST of '/svn/IL_IES_Demo/!svn/me': authorization failed: Could not authenticate to server: rejected Basic challenge (http://10.118.19.200:8080)