home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / tools / listdirs < prev    next >
Encoding:
Text File  |  1992-08-28  |  1.0 KB  |  34 lines

  1. #! /bin/sh
  2.  
  3. # This script generates a list of the subdirectories of the current
  4. # directory according to the following:
  5. #     1. any subdirectory named RCS is excluded from the list;
  6. #     2. if there is a file called EXCLUDEDIRS in the current
  7. #        directory, any directories whose names are listed
  8. #        in that file are excluded.
  9. #    3. if there is a file called FIRSTDIRS in the current
  10. #       directory, any directories whose names are listed
  11. #       in that directory are listed first in the list,
  12. #       in the order they appear in the file.
  13. # The resulting list is echoed on a single line to stdout.
  14.  
  15. firstdirs=""
  16. if [ -r FIRSTDIRS ] ; then
  17.   firstdirs="`cat FIRSTDIRS`" ;
  18. fi
  19. exceptions=`( echo ' 'RCS' ' ;
  20.           if [ -r EXCLUDEDIRS ] ; then
  21.         cat EXCLUDEDIRS ;
  22.           fi ;
  23.           echo ' '$firstdirs' ')`
  24. echo `if [ -r FIRSTDIRS ] ; then cat FIRSTDIRS ; fi ;
  25.       for file in * ; do
  26.         if [ -d $file ] ; then
  27.           if echo \"$exceptions\" | fgrep -v " $file " 1>&- ; then
  28.             echo $file ;
  29.           fi
  30.         fi ;
  31.       done`
  32.