home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume8 / libhoward / part08 / cia.b < prev    next >
Text File  |  1989-10-01  |  1KB  |  66 lines

  1.   
  2. # cia - Check in arguments to RCS
  3. #
  4. # $Header: cia.b,v 1.3 89/09/23 14:06:03 howard Exp $
  5. #
  6. # Copyright 1989 Howard Lee Gayle
  7. # This file is written in the ISO 8859/1 character set.
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License version 1,
  11. # as published by the Free Software Foundation.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. #
  22. # Shell variables:
  23. # c - flag to check out again
  24. # f - steps through files
  25. # r - RCS file
  26. # u - usage string
  27.  
  28. CMDNAME=cia
  29. export CMDNAME
  30. u="Usage: $CMDNAME [-u] file..."
  31. if [ "x$1" = x-u ]
  32. then
  33.    c=1
  34.    shift
  35. fi
  36. if [ $# -eq 0 ]
  37. then
  38.    echo "$u" 1>&2
  39.    exit 1
  40. fi
  41. if [ ! -d RCS ]
  42. then
  43.    echo "$CMDNAME: no RCS directory" 1>&2
  44.    exit 1
  45. fi
  46. for f
  47. do
  48.    if [ -r "$f" ]
  49.    then
  50.       r="RCS/$f,v"
  51.       if [ -f "$r" ]
  52.       then
  53.          echo "$CMDNAME: $r: RCS file already exists" 1>&2
  54.       else
  55.          ci "$f" "$r" && rcs -L "$r"
  56.          if [ $c ]
  57.          then
  58.             co "$f"
  59.          fi
  60.       fi
  61.    else
  62.       echo "$CMDNAME: $f: file not readable" 1>&2
  63.    fi
  64. done
  65.  
  66.