Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
983 B

  1. #
  2. # Get argument
  3. #
  4. $Errs = 0;
  5. for (@ARGV) {
  6. if (/^[-\/]file=(.*)$/i) { $fname1 = $1; next; }
  7. }
  8. open FILE1, $fname1 ;
  9. if( !FILE1 ){
  10. print "$fname1 : Error E0000 : Could not open $fname1\n";
  11. exit( 1 );
  12. }
  13. @File1Lines = <FILE1>;
  14. # Check to see if File1 starts with a section - else error out
  15. #if( !$stripsection ){
  16. #
  17. # if( !($File1Lines[0] =~ /\[(.*)]/i)){
  18. # print "$fname1 : Error E0000 : File $fname1 does not begin with a section\n" ;
  19. # exit 1;
  20. # }
  21. #}
  22. foreach $Line (@File1Lines){
  23. # Go past blank lines
  24. if($Line =~ /^\s+/){
  25. next;
  26. }
  27. #Lowecase before adding
  28. $Line =~ tr/A-Z/a-z/;
  29. #Skip line if already present in our Assoc array
  30. #else print it and set it as visited
  31. if($Array{$Line} == 0){
  32. print $Line;
  33. #Mark as visited
  34. $Array{$Line} = 1;
  35. }else{
  36. # print "Dup found - $Line";
  37. }
  38. }
  39. print "\n";
  40. exit( 0 );