home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / c / cops_104.zip / cops_104 / extra_src / bad_dir.pl next >
Text File  |  1992-03-10  |  696b  |  22 lines

  1. # this prints out "bad" directory names:
  2.  
  3. #   string of things that are OK; currently, this
  4. # is anything that starts with a letter and number or the
  5. # chars "#", "$", "-", or "+" (or the same situation, with a
  6. # "." prepending):
  7. $ok_string  = "\/\.?[A-Za-z0-9\#\$\-\+]+[^\/]*$";
  8.  
  9. # "." and ".." are cool, as are
  10. # anything starting with the magic string;
  11. # but any unprintables are bad...
  12. if ((($ARGV[0] !~  /\.{1,2}$/) && ($ARGV[0] !~ /$ok_string/) &&
  13.     ($ARGV[0] ne "/")) || ($ARGV[0] =~ /\.\..+$/) ||
  14.     ($ARGV[0] =~ /[*\001-\040\177-\377]/)) {
  15.         # print "MATCH: ###", $ARGV[0], "\@\@\@\n";
  16.         print "\"", $ARGV[0], "\"\n";
  17.         }
  18. # else {
  19. #     print "\tNO MATCH: ###", $ARGV[0], "###\n";
  20. #     }
  21.  
  22.