1. cd subdir
2. ls -1 > ../1.out
3. gawk -f lsnu.awk ../1.out
The lsnu.awk script
{
if ($1 ~ /\.c$/){
cfiles[$1]=1;
print $1;
next;
}
if ($1 ~ /\.o$/){
ofiles[$1]=1;
#printf("%s\n",$1);
next;
}
}
END{
printf("-------------\n");
for ( i in cfiles){
f=i;
gsub(/\.c$/,".o",i);
if (ofiles[i]!=1){
printf("%s ",f);
}
}
printf("\n");
}
No comments:
Post a Comment