cc -g -mcpu=800 -type -nostdinc -DFLAG1 -DFLAG2-float -fno-builtin cc -g -mcpu=800 -type -nostdinc -DFLAG1 -D_FLAG2 -fvolatile -fno-builtin -I #### #!/usr/local/bin/perl $file = shift @ARGV; chomp $file; open(BUILD,"$file") || die "File $file not found \n!"; @recs = ; $count = 0; foreach(@recs) { $str = m/.\-D/; if ($str) { @flags = split(" ",$_); } foreach (@flags) { $str2 = m/^\-D/; if ($str2) { $finalflags[$count] = $_; $count++; } } } @sortflags = sort @finalflags; foreach(@sortflags) { print"$_\n"; } #### rm out1.txt rm final.txt perl dir.pl > out1.txt #tells the flags repeated uniq -d out1.txt > final.txt #tells uniq flags uniq -u out1.txt >> final.txt #### if ($found = grep(/\b$_\b/,@finalflags) donot store inarray else store in array