diff options
author | Nick White <git@njw.me.uk> | 2010-08-11 02:30:46 +0100 |
---|---|---|
committer | Nick White <git@njw.me.uk> | 2010-08-11 02:30:46 +0100 |
commit | 0a1be1878992ec2f53fe30fd1e94e7a1a55cac32 (patch) | |
tree | f6a447bdbb9c8909b5861c78f8507a026ecbfd70 | |
parent | ac1e187d2e852aa603cf9ff0bb57e67caadd9125 (diff) | |
download | njw-website-0a1be1878992ec2f53fe30fd1e94e7a1a55cac32.tar.bz2 njw-website-0a1be1878992ec2f53fe30fd1e94e7a1a55cac32.zip |
Improve sed in mutt autoencrypt script
-rw-r--r-- | software/scripts/encrypt-if-possible.sh | 11 |
1 files 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/>$//g +s/.*/send-hook & "set crypt_autoencrypt = yes"/g' |