The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 04-21-2005
Omkumar Omkumar is offline
Registered User
 

Join Date: Mar 2005
Posts: 22
This will do,

Compare.sh
#!/bin/sh
#cut column 3 from FileA and put it to FileA.tmp
cat FileA | cut -f3 -d";" > FileA.tmp
#cut column 4 from FileB and put it to FileB.tmp
cat FileB | cut -f4 -d";" > FileB.tmp
#compare FileA.tmp and FileB.tmp
diff FileA.tmp FileB.tmp
rm FileA.tmp FileB.tmp

sh Compare.sh
2a3
> d
4,5d4
< f
< q

-Om
Reply With Quote