Forked from sergeiwaigant/url_encode_string_with_linux_tools.md
Last active
October 22, 2024 18:37
-
-
Save paddy74/6098d4fea44c362892590a921155315e to your computer and use it in GitHub Desktop.
Simply URL encode string with Linux/Bash/Shell tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reference https://stackoverflow.com/a/34407620/13287790 | |
# Requires `jq` | |
# $ echo -n "encode this" | jq -sRj @uri | |
# encode%20this | |
# MY_VAR=$(urlencode "encode this") | |
echo -n "${1}" | jq -sRj @uri |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment