summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMartin Gütlein <martin.guetlein@gmail.com>2010-03-26 17:10:10 +0100
committerMartin Gütlein <martin.guetlein@gmail.com>2010-03-26 17:10:10 +0100
commit104a542e678aca8d4909633a48f1a4e7d93c659e (patch)
tree72599734d0662e3f4f1625b711eeb44630169276 /bin
parentab77945c4769b4a73336beb046e62221d5c620f8 (diff)
adding redirect hack script/feature_uri->prediction_feature
Diffstat (limited to 'bin')
-rwxr-xr-xbin/redirect.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/bin/redirect.sh b/bin/redirect.sh
new file mode 100755
index 0000000..d309f1a
--- /dev/null
+++ b/bin/redirect.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+OUTFILE="/tmp/tmp_redirect_out"
+
+cmd="curl -v $1"
+`$cmd &> $OUTFILE`
+
+RES=`grep "< HTTP.*303" $OUTFILE`
+RES=${RES// /} # remove emtpy spaces
+
+#echo $RES
+
+if [ -z $RES ]; then
+ #echo "no"
+ echo ""
+else
+ #cat $OUTFILE
+ RES=`grep "< Location: " $OUTFILE`
+ RES=${RES//"< Location: "/} # remove lcoation spaces
+ echo $RES
+fi
+
+#match301=$(expr index "$res" 301)
+#
+#echo
+#echo "result:"
+#echo
+#cat $OUTFILE
+
+#echo $match301
+
+#for testing try 301 instead of 303 with google.de/www.google.de \ No newline at end of file