How to deal with the method of urldecode in Bash
This article mainly explains "how to deal with the method of urldecode in Bash". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to deal with the method of urldecode in Bash".
Problem description
This note will record: in Bash, the method of urldecode, and related problem handling.
Solution
This code is copied from Stack Overflow.
Function urldecode () {: "${* / + /}"; echo-e "${_ / /% /\\ x}";} function urldecode () {local I = "${* / + /}"; echo-e "${icontrol% /\\ x}";}
The first one is so strangely written that it contains all kinds of Bash knowledge:
1): to prevent "${* / + /}" from being executed as a command
2) $_ represents the last parameter of the previous command, that is, the parsing result of "${* / + /}"
3) $* indicates all the parameters of the incoming command
4) ${pUnip _ blank /} means to replace the + of the variable p with spaces, while ${pAccord _ blank /} means to replace all the + of the variable p with spaces
Thank you for your reading, the above is the content of "how to deal with the method of urldecode in Bash". After the study of this article, I believe you have a deeper understanding of how to deal with the method of urldecode in Bash, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!