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 the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 11-18-2007
summer_cherry summer_cherry is offline Forum Advisor  
Registered User
  
 

Join Date: Jun 2007
Location: Beijing China
Posts: 1,088
awk

input:
Code:
a:
data01
data02
data03
data04
data05
b:
/vol/vx/data01
/vol/vx/data02
/vol/vx/data05
output:
Code:
No entry for:data03
No entry for:data04
code:
Code:
nawk 'BEGIN{FS="/"}
{
if (NR==FNR) 
	test[NR]=$4
else
{
	flag=0
	for (i in test)
	{
		if ($1==test[i]) 
			flag=1
	}
	if (flag==0)
		print "No entry for:"$1
}
}' b a