Skip to content

Instantly share code, notes, and snippets.

@egyptiankarim
Last active October 16, 2015 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egyptiankarim/f34121ba41e3fc2b3436 to your computer and use it in GitHub Desktop.
Save egyptiankarim/f34121ba41e3fc2b3436 to your computer and use it in GitHub Desktop.
Shortcut for encoding/decoding URLs.
#!/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