gpg --batch --yes --edit-key trust

mark at proseconsulting.co.uk mark at proseconsulting.co.uk
Mon Jul 26 10:14:01 CEST 2010


 On Mon 26/07/10  9:01 AM , mark at proseconsulting.co.uk sent:
> Perfect, that'll do me just fine!  I've scripted this suggestion:
> 
> #!/bin/ksh
> #
> # Set trust level for a given GPG key
> #
> AWK=/bin/gawk
> [ -x /bin/nawk ] && AWK=/bin/nawk
> 
> [ $# -ne 2 ] && echo "Syntax: $0 key trust-level" && exit 1
> 
> gpg --fingerprint --list-keys "$1" |\
> $AWK -v tmpfile="$TMPFILE" -v trustlevel="$2" '
> /fingerprint/ { for (i=4; i
> END {
> FS=":"
> cmd="gpg --export-ownertrust"
> while (cmd | getline) if ($1!=fpr) print
> close(cmd)
> print fpr ":" trustlevel ":"
> }
> ' | gpg --import-ownertrust

Sorry, -v tmpfile="$TMPFILE" was a throw-back to an earlier test, you don't need to pass that variable to AWK, i.e.

<snip>
gpg --fingerprint --list-keys "$1" |\
    $AWK -v trustlevel="$2" '
</snip>

And sorry about the formatting.  My mail client stripped all the indentation.





More information about the Gnupg-users mailing list