From: martin f. krafft Date: Mon, 5 May 2008 13:46:51 +0000 (+0100) Subject: url encoding with zsh X-Git-Url: https://git.madduck.net/etc/zsh.git/commitdiff_plain/54af9aa606acad109e2f1833be24c4789667740e?ds=inline url encoding with zsh --- diff --git a/.zsh/func/urlencode b/.zsh/func/urlencode new file mode 100644 index 0000000..21e8ab7 --- /dev/null +++ b/.zsh/func/urlencode @@ -0,0 +1,4 @@ +# http://www.michael-prokop.at/computer/config/.zshrc +setopt localoptions extendedglob +input=( ${(s::)1} ) +print ${(j::)input/(#b)([^A-Za-z0-9_.!~*\'\(\)-])/%$(([##16]#match))}