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 / perl / is_able.chk < prev    next >
Text File  |  1992-03-10  |  1KB  |  45 lines

  1. #!/bin/sh -- need to mention perl here to avoid recursion
  2. 'true' || eval 'exec perl -S $0 $argv:q';
  3. eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
  4. & eval 'exec /usr/bin/perl -S $0 $argv:q'
  5.         if 0;
  6.  
  7. #
  8. #  is_able.chk
  9. #
  10. #   This shell script checks the permissions of all files and directories
  11. # listed in the configuration file "is_able.lst", and prints warning messages
  12. # according to the status of files.  You can specify world or group readability
  13. # or writeability.  See the config file for the format of the configuration
  14. # file.
  15. #
  16. #   Mechanism:  This shell script parses each line from the configure file
  17. # and uses the "is_able.pl" program to check if any of
  18. # the directories in question are writable by world/group.
  19. #
  20.  
  21. require 'is_able.pl';
  22. require 'file_mode.pl';
  23. require 'glob.pl';
  24.  
  25. if ($ARGV[0] eq '-d') {
  26.     shift;
  27.     $debug = $glob'debug = 1;  # maybe should turn off glob'debug afterwards
  28. }
  29.  
  30. unshift (@ARGV, "is_able.lst" ) unless @ARGV;
  31.  
  32. while (<>) {
  33.     next if /^\s*#/;
  34.     split;
  35.     next unless @_ == 3;
  36.     ($file, $x, $y) = @_;
  37.     @files = $file =~ /[\[?*]/ ? &'glob($file) : ($file);
  38.     for $file (@files) {
  39.     print STDERR "is_able $file $x $y\n" if $debug;
  40.     &'is_able($file, $x, $y);
  41.     }
  42. }
  43.  
  44. 1;
  45.