     	SUBROUTINE SPAWNS( ICODE, TEXT )
C
C  PROGRAMMER:  R.S. ZHOU
C		ALFRED UNIVERSITY, MAY-1987
C
C	THIS ROUTINE SPAWNS A SYSTEM SUBPROCESS.
C
     	CHARACTER COMM*80, TEXT*(*)

     	COMM = TEXT
     	NCH = NALPHA( COMM, -80 )
     	NSP = INDEX( COMM(1:NCH), ' ' )
     	ICODE = 0
     	IF( NSP.GT.0 ) GOTO 111
C
C  GET THE COMMAND LINE...
C
     	CALL COLORS(1)
     	WRITE(6,1000)
1000	FORMAT('$SPAWN> ')
     	READ(5,1001,ERR=999,END=999) COMM
1001	FORMAT(A)
     	IF( COMM.EQ.' ' ) GOTO 999
     	NCH = NALPHA( COMM, -80 )

111	CALL COLORS(-1)
     	WRITE(6,222)
222	FORMAT('$Working...')
     	CALL COLORS(1)
     	CALL LIB$SPAWN( COMM(NSP+1:NCH) )
     	CALL PAUSES( 1 )
     	ICODE = 1

999	RETURN
     	END
