The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




Thread: diff
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 04-23-2007
DeepakS's Avatar
DeepakS DeepakS is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 74
Code:
/usr/bin/diff $F_PATH/$F_NAME1 $F_PATH/$F_NAME2 >> /dev/null 2>&1

if [ $? -eq 0 ] 
then    # NO CHANGE
	rm $F_PATH/$F_NAME1
else	# CHANGE
	rm $F_PATH/$F_NAME2
	uuencode $F_PATH/$F_NAME1 $F_NAME1| mailx -s "$F_NAME1 CHANGED" $NC_EMAIL
fi
That should do basically what you need it to, unless I misunderstood the requirements.

You'll need to add the file transfer bits above that block yourself.