home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / irix / scripts / rcs / Comprcs < prev    next >
Encoding:
Text File  |  1994-08-02  |  1.7 KB  |  76 lines

  1. #! /bin/csh -f
  2. #
  3. # $Header: /usr/people/carlson/scripts/RCS/Comprcs,v 1.3 91/07/27 19:57:33 chris Exp $
  4. #
  5. # Comprcs    Compare RCS files with files in another directory.
  6. #
  7. # Synopsis:
  8. #    Comprcs [-d <dir>] [-<opts>] [<file>...]
  9. #
  10. # Description:
  11. #    Performs an rcsdiff on all files in the local RCS directory with
  12. #    files in the directory specified.  If no directory specified, it
  13. #    will check if an environment variable COMPRDIR exists and use the
  14. #    directory there.  If neither exists, assumes the local directory.
  15. #
  16. #    If a file is provided, checks only this file.
  17. #
  18. # Revision History:
  19. #    $Log:    Comprcs,v $
  20. # Revision 1.3  91/07/27  19:57:33  chris
  21. # Fixed problem with recognizing options.
  22. # Fixed problem with no COMPRDIR environment variable defined.
  23. # Revision 1.2  91/07/27  19:51:52  chris
  24. # Modified to allow no directory specification.  Will assume current
  25. #   directory.
  26. # Added -f flag to /bin/csh.
  27. # Added RCS tags.
  28. #---------------------------------------------------------------------------
  29.  
  30. set afile = ""
  31. set dir = ""
  32. set opts = ""
  33.  
  34. while ( "$1" != "" )
  35.     if ( "$1" == "-d" ) then
  36.     set dir = $2
  37.     shift; shift
  38.     else
  39.     set x = `echo "$1" | grep "^-.*"`
  40.     if ( "$x" != "" ) then
  41.         set opts = ($opts $1)
  42.         shift
  43.     else
  44.         set afile = ($afile $1)
  45.         shift
  46.     endif
  47.     endif
  48. end
  49.  
  50. if ( "$dir" == "" ) then
  51.     if ( $?COMPRDIR ) then
  52.     set dir = $COMPRDIR
  53.     endif
  54. endif
  55.  
  56. if ( "$dir" == "" ) set dir = .
  57.  
  58. if ( "$afile" == "" ) then
  59.     foreach rcs_file ( RCS/* )
  60.     set base = `basename $rcs_file ,v`
  61.     echo "***--- rcsdiff $dir/$base"
  62.     rcsdiff $opts $dir/$base
  63.     end
  64. else
  65.     foreach file ( $afile )
  66.     echo "***--- rcsdiff $dir/$file"
  67.     rcsdiff $opts $dir/$file
  68.     end
  69. endif
  70.  
  71. ### Local Variables:
  72. ### auto-fill-hook: nil
  73. ### End:
  74.