标签:oca post logs color bsp shell http tps title
from https://gist.github.com/cdown/1163649
function urlencode() { local LANG=C for ((i=0;i<${#1};i++)); do if [[ ${1:$i:1} =~ ^[a-zA-Z0-9\.\~\_\-]$ ]]; then printf "${1:$i:1}" else printf ‘%%%02X‘ "‘${1:$i:1}" fi done } urldecode() { # urldecode <string> local url_encoded="${1//+/ }" printf ‘%b‘ "${url_encoded//%/\\x}" }
好用就行
url_encode and url_decode in Shell
标签:oca post logs color bsp shell http tps title
原文地址:http://www.cnblogs.com/westfly/p/7045162.html