1
0
mirror of https://github.com/octoleo/Purse.git synced 2024-12-28 20:12:38 +00:00

BSD-compatible grep flags. Match username to EOL.

This commit is contained in:
drduh 2016-07-10 17:47:27 +00:00 committed by GitHub
parent 0efd10110b
commit 42f664e920

6
pwd.sh
View File

@ -1,12 +1,12 @@
#!/usr/bin/env bash
#
# Script for managing passwords in a GunPG symmetrically encrypted file.
# Script for managing passwords in a GnuPG symmetrically encrypted file.
set -o errtrace
set -o nounset
set -o pipefail
filter="$(command -v grep) --invert-match --regexp"
filter="$(command -v grep) -v --regexp"
gpg="$(command -v gpg || command -v gpg2)"
safe="${PWDSH_SAFE:=pwd.sh.safe}"
@ -87,7 +87,7 @@ read_pass () {
get_pass "
Enter password to unlock ${safe}: "
printf "\n\n"
decrypt ${password} ${safe} | grep " ${username}" || fail "Decryption failed"
decrypt ${password} ${safe} | grep " ${username}$" || fail "Decryption failed"
}