From 0a1be1878992ec2f53fe30fd1e94e7a1a55cac32 Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 11 Aug 2010 02:30:46 +0100 Subject: Improve sed in mutt autoencrypt script --- software/scripts/encrypt-if-possible.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/software/scripts/encrypt-if-possible.sh b/software/scripts/encrypt-if-possible.sh index 36e15cb..f067752 100644 --- a/software/scripts/encrypt-if-possible.sh +++ b/software/scripts/encrypt-if-possible.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2009 Nick White +# Copyright 2009,2010 Nick White # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,7 +20,8 @@ # To use this in mutt, add the following to your ~/.muttrc: # source encrypt-if-possible.sh| -gpg --list-keys | sed \ - -e '/@/!d' \ - -e 's/\(.*\)<\(.*\)>/\2/g' \ - -e 's/\(.*\)/send-hook \1 "set crypt_autoencrypt = yes"/g' +gpg --list-keys | sed ' +/@/!d +s/^.*$//g +s/.*/send-hook & "set crypt_autoencrypt = yes"/g' -- cgit v1.2.3