summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlocalsmsapps9
1 files changed, 6 insertions, 3 deletions
diff --git a/localsmsapps b/localsmsapps
index 0938820..54379a6 100755
--- a/localsmsapps
+++ b/localsmsapps
@@ -6,13 +6,16 @@ simpleword() {
echo "$1" | tr '[A-Z]' '[a-z]' | egrep '^[a-z][a-z0-9-]+$' || exit 1
}
+uriunescape() {
+ echo "$1" | perl -e 'use URI::Escape; print lc(uri_unescape(<STDIN>));'
+}
+
urlencode() {
-# echo "$1" | perl -e 'use Encode; use URI::Escape; use URI::URL; print URI::URL->new(Encode::decode("utf8", uri_unescape(<STDIN>)))."\n";'
echo "$1" | perl -e 'use URI::URL; print URI::URL->new(<STDIN>)."\n";'
}
-phone="$1"; shift
-set -- `echo "$@" | perl -e 'use URI::Escape; print lc(uri_unescape(<STDIN>));' | sed -e 's/\+/ /g'`
+phone=`uriunescape "$1" | sed -e 's/\+/ /g'`; shift
+set -- `uriunescape "$@" | sed -e 's/\+/ /g'`
app=`simpleword "$1"`; shift
case "$app" in