urlencoding与一个纯BASH内置

opposite of https://www.commandlinefu.com/commands/view/10014/urldecoding-with-one-pure-bash-builtin ;-)
.

0

linux命令:function URLEncode { local dataLength="${#1}"; local index; for ((index = 0;index < dataLength;index++)); do local char="${1:index:1}"; case $char in [a-zA-Z0-9.~_-]) printf "$char"; ;; *) printf "%%%02X" "'$char"; ;; esac; done; } } done; esac; ;; "'$char"; "%%%02X" printf *) ;; "$char"; printf [a-zA-Z0-9.~_-]) in $char case char="${1:index:1}"; local do dataLength;index++)); < 0;index = ((index for index; local dataLength="${#1}"; local { URLEncode function function URLEncode { local dataLength="${#1}"; local index; for ((index = 0;index < dataLength;index++)); do local char="${1:index:1}"; case $char in [a-zA-Z0-9.~_-]) printf "$char"; ;; *) printf "%%%02X" "'$char"; ;; esac; done; }rootopen.com
linux命令:function URLEncode { local dataLength="${#1}"; local index; for ((index = 0;index < dataLength;index++)); do local char="${1:index:1}"; case $char in [a-zA-Z0-9.~_-]) printf "$char"; ;; *) printf "%%%02X" "'$char"; ;; esac; done; } } done; esac; ;; "'$char"; "%%%02X" printf *) ;; "$char"; printf [a-zA-Z0-9.~_-]) in $char case char="${1:index:1}"; local do dataLength;index++)); < 0;index = ((index for index; local dataLength="${#1}"; local { URLEncode function function URLEncode { local dataLength="${#1}"; local index; for ((index = 0;index < dataLength;index++)); do local char="${1:index:1}"; case $char in [a-zA-Z0-9.~_-]) printf "$char"; ;; *) printf "%%%02X" "'$char"; ;; esac; done; }rootopen.com
mi莎 2018-09-11 09:55:30
输出
URLEncode https://www.commandlinefu.com/commands/by/emphazer

https%3A%2F%2Fwww.commandlinefu.com%2Fcommands%2Fby%2Femphazer

评论

相关推荐
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

热门文章