home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / fractal / kaos.lha / bin / rsccs < prev    next >
Encoding:
Text File  |  1989-12-28  |  1.1 KB  |  56 lines

  1. #!/bin/sh
  2. # Recursively execute an sccs command on all subdirectories
  3. # The purpose is the recursive execution of an sccs command
  4. #     not worrying about which subdirectory a specified SCCS file is.
  5. # It will automatically find and restore it on the right subdirectory for you.
  6. # It takes all sccs command line arguments.
  7. # WARNING: You should issue it from the top directory at the moment to serach
  8. #    for all sub directories; otherwise it will only serach for the
  9. #    current directory and subdirectories called *lib
  10. # eg rsccs edit source.c (to edit a file you do not know where it is)
  11. #    rsccs unedit source.c (to unedit a file you do not know where it is)
  12. #    rsccs vi source.c (to vi a file)
  13. #    rsccs get SCCS (to get all files from SCCS archives)
  14.  
  15. case $# in
  16. 0)    echo Error: Too few arguments!
  17.     exit ;;
  18. 1)    echo `pwd`: sccs $*
  19.     sccs $* ;;
  20. *)    
  21.     for i in $*
  22.     do
  23.         case $i in
  24.         -*)
  25.             ;;
  26.         SCCS)
  27.             echo `pwd`: sccs $*
  28.             sccs $*
  29.             ;;
  30.         *.[cfh])
  31.             if test -f SCCS/s.$i
  32.             then
  33.                 echo `pwd`: sccs $*
  34.                 sccs $*
  35.                 exit
  36.             fi
  37.             ;;
  38.         *)
  39.             ;;
  40.         esac
  41.     done
  42.     ;;
  43. esac
  44.  
  45. for i in * 
  46. do    
  47.     case $i in
  48.     *lib)
  49.         cd $i
  50.         ${KAOSHOME}/bin/rsccs $*
  51.         cd ..
  52.         ;;
  53.     *) 
  54.     esac
  55. done
  56.