11 echo -e "Error arguments!\n\t./add_back.sh -t/-h filename backaddress";
12 echo -e "\t\t-t means text\n\t\t-h means html";
17 if [ ! -f "$2" ]; then
18 echo "File missing: $2!" >>/tmp
/kps
23 echo "Please input Home address."
27 if [ $MODE = "TEXT" ]; then
28 sed -i 's/</\</g' $2
29 sed -i 's/>/\>/g' $2
30 sed -i '1i<html><A href="'$3'">Back to home</A>\n<pre>' $2
31 echo "</pre></html>" >> $2
32 cp .
/google_adsense
/tmp
/google_adsense
33 cat $2 >> /tmp
/google_adsense
34 mv /tmp
/google_adsense
$2
38 if [ $MODE = "WEB" ]; then
39 addr
=`echo $3 | sed 's/\//\\\\\//g'`
40 grep '<body>' $2 >/dev
/null
&& sed -i 's/<body>/<body>\n<A href="'$addr'">Back to home<\/A>/g' $2
41 grep '<BODY>' $2 >/dev
/null
&& sed -i 's/<BODY>/<BODY>\n<A href="'$addr'">Back to home<\/A>/g' $2
42 cp .
/google_adsense
/tmp
/google_adsense
43 cat $2 >> /tmp
/google_adsense
44 mv /tmp
/google_adsense
$2