#!/bin/bash wget http://www.yahoo.com n_count=`cat index.html | wc -l` o_count=`cat index.html.BU | wc -l` echo "Counting lines..." if [ $o_count -gt $n_count ]; then echo "The web page has more lines now" elif [ $o_count -lt $n_count ]; then echo "The web page has less lines now" else echo "The web page has the same number of lines" fi echo "Old count is $o_count, the new count is $n_count" echo "Backing up ..." cat index.html > index.html.BU echo "Cleaning up..." rm -rf index.html echo "Done"