md5sum "$1" 2> /dev/null
}
-# convert escaped characters from gpg output back into original
-# character
-# FIXME: undo all escape character translation in with-colons gpg output
-unescape() {
- echo "$1" | sed 's/\\x3a/:/g'
+# convert escaped characters in pipeline from gpg output back into
+# original character
+# FIXME: undo all escape character translation in with-colons gpg
+# output
+gpg_unescape() {
+ sed 's/\\x3a/:/g'
}
-# convert nasty chars into gpg-friendly form
+# convert nasty chars into gpg-friendly form in pipeline
# FIXME: escape everything, not just colons!
-escape() {
- echo "$1" | sed 's/:/\\x3a/g'
+gpg_escape() {
+ sed 's/:/\\x3a/g'
}
-
# remove all lines with specified string from specified file
remove_line() {
local file
continue
fi
# if the user ID does not match, skip
- if [ "$(unescape "$uidfpr")" != "$userID" ] ; then
+ if [ "$(echo "$uidfpr" | gpg_unescape)" != "$userID" ] ; then
continue
fi
# if the user ID validity is not ok, skip