The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



Thread: diff
View Single Post in UNIX 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: 60
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.
Reply With Quote