6 echo "usage: gpvi FILENAME" >&2
12 rcpt="$(gpg --batch --quiet --decrypt --list-only --status-fd 1 <"$file" | sed -n '/^\[GNUPG:\]/s/^.*ENC_TO \([^ ]*\) .*$/-r \1/p')"
13 tf="$(mktemp /tmp/gpvi.XXXXXX)"
15 gpg --quiet --decrypt --armor <"$file" >"$tf"
16 omd5="$(md5sum "$tf")"
18 nmd5="$(md5sum "$tf")"
19 if [ "$omd5" != "$nmd5" ]; then
20 gpg --quiet --encrypt --armor $rcpt <"$tf" >"${file}.new"
23 mv "${file}.new" "$file"
25 echo "gpvi: file left unchanged, not overwriting old" >&2