Last active
October 16, 2015 21:30
-
-
Save egyptiankarim/f34121ba41e3fc2b3436 to your computer and use it in GitHub Desktop.
Shortcut for encoding/decoding URLs.
This file contains 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
#!/bin/sh | |
# | |
# Shortcut for encoding/decoding URLs. | |
usage () { | |
echo "Usage: $ furl [(d|e)] [URL]\n" | |
exit 1 | |
} | |
if [ "$#" -ne 2 ]; then | |
usage | |
fi | |
case $1 in | |
"d") python -c "import sys, urllib as ul; print ul.unquote_plus('$2')";; | |
"e") python -c "import sys, urllib as ul; print ul.quote_plus('$2')";; | |
*) usage;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment