#!/bin/sh -c
# takes the string from the clipboard...
export CLIPBOARD_CONTENTS=`pbpaste`
# signs it using your GPG key
export GPG_SIGNED=`echo $CLIPBOARD_CONTENTS | gpg -as -`
# and writes it back to the clipboard for pasting
echo $GPG_SIGNED | pbcopy