From 209fa89db7684bc721bd9b30a8d00eeb1f6e651a Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Fri, 6 Mar 2020 12:04:50 +0100 Subject: [PATCH] mutt: Add ciscoclean --- dotfiles/mutt/scripts/ciscoclean | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 dotfiles/mutt/scripts/ciscoclean diff --git a/dotfiles/mutt/scripts/ciscoclean b/dotfiles/mutt/scripts/ciscoclean new file mode 100755 index 0000000..a94c4d5 --- /dev/null +++ b/dotfiles/mutt/scripts/ciscoclean @@ -0,0 +1,42 @@ +#!/bin/sh + +set -e + +PROG="$0" + +ciscowipe() { + # Remove secure-web.cisco.com prefix + sed -E "s!https?://secure-web.cisco.com/[^/ ]*/!!g" | + # URL decode + # Decodes all URL escape sequences + #sed -e 's!+! !g;s!%\([0-9A-Fa-f]\{2\}\)!\\x\1!g' | xargs -0 printf "%b" + # Decodes only some escape sequences, but leaves others, like spacs, + # as is. + sed 's!%3A!:!g;s!%2F!/!g;s!%3F!?!g;s!%3D!=!g;s!%26!\&!g' +} + +usage() { + cat<