Last active
August 29, 2015 14:02
-
-
Save bltavares/f4113a77ad93707171f2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
password_file=$1 | |
update_account() { | |
USERNAME=$1 | |
PASSWORD=$2 | |
FILE=$3 | |
awk -i inplace "/username: '$USERNAME'/ { print \$0; getline; \$2="'$PASSWORD'" } { print \$0 }" $FILE | |
} | |
while read line; do | |
update_account $(tr ':' ' ' <<<"$line") file/accounts/accounts.rb | |
done < $password_file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment