View Single Post
  #2  
Old 27th April 2007, 05:16
ghostdog74 ghostdog74 is offline
Junior Member
 
Join Date: Aug 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you can use awk


Code:
awk -v file="Prac1" ' BEGIN {  # get all sids of Prac1 into array
		while( (getline line < file )>0 ) { 
			if (line ~ /^#/ ) continue #skip comments 
			mprac[line]
		}
      }
      /^#/ {next} #skip comments line in Students file
	{ 		
		if (!( $1 in mprac )) {
			print "Sid: " $1 " not in " FILENAME
		}
	
	}
	
' "Students"
Reply With Quote