summaryrefslogtreecommitdiffstats
path: root/tools/urlencode
diff options
context:
space:
mode:
Diffstat (limited to 'tools/urlencode')
-rwxr-xr-xtools/urlencode8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/urlencode b/tools/urlencode
new file mode 100755
index 0000000..7924db9
--- /dev/null
+++ b/tools/urlencode
@@ -0,0 +1,8 @@
+#!/bin/bash
+read foo
+if [[ $* == -d ]]
+then
+perl -MURI::Escape -e 'print uri_unescape($ARGV[0])' $foo
+else
+perl -MURI::Escape -e 'print uri_escape($ARGV[0])' $foo
+fi