      SUBROUTINE MAIN
      LOGICAL*1 BUF(400)
      INTEGER GETARG, OPEN
      INTEGER I, INT
      I=1
23000 IF(.NOT.(GETARG(I, BUF, 400) .NE. -1))GOTO 23002
      IF(.NOT.(BUF(1) .EQ. 45 .AND. BUF(2) .EQ. 0))GOTO 23003
      INT = 1
      GOTO 23004
23003 CONTINUE
      IF(.NOT.(BUF(1) .EQ. 63 .AND. BUF(2) .EQ. 0))GOTO 23005
      CALL ERROR (20Husage:  cat [file] .)
      GOTO 23006
23005 CONTINUE
      INT = OPEN(BUF, 1)
23006 CONTINUE
23004 CONTINUE
      IF(.NOT.(INT .EQ. -3))GOTO 23007
      CALL CANT(BUF)
23007 CONTINUE
      CALL FCOPY(INT, 2)
      IF(.NOT.(INT .NE. 1))GOTO 23009
      CALL CLOSE(INT)
23009 CONTINUE
23001 I=I+1
      GOTO 23000
23002 CONTINUE
      IF(.NOT.(I .EQ. 1))GOTO 23011
      CALL FCOPY (1, 2)
23011 CONTINUE
      RETURN
      END
