From 104a542e678aca8d4909633a48f1a4e7d93c659e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20G=C3=BCtlein?= Date: Fri, 26 Mar 2010 17:10:10 +0100 Subject: adding redirect hack script/feature_uri->prediction_feature --- bin/redirect.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 bin/redirect.sh (limited to 'bin') 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 -- cgit v1.2.3