#-h- tee.r 850 asc 26-apr-81 07:53:51 [002,100] #-h- defns 168 asc 26-apr-81 07:53:44 [002,100] # symbols definitions for tee # put on a file called 'defns' # used only by the tee tool define(MAXTEEFILES,arith(MAXOFILES,-,3)) #Number of output files allowed #-h- main 558 asc 26-apr-81 07:53:45 [002,100] ## tee - copy input to standard output and named files DRIVER(tee) integer files (MAXTEEFILES) integer nf, int, i integer getarg, create character buf(MAXLINE) character getc character c call query("usage: tee [file] ...") nf = 0 for (i=1; getarg(i,buf,MAXLINE)!=EOF; i=i+1) { nf = nf + 1 if (nf > MAXTEEFILES) call error ('too many files.') files(nf) = create(buf,WRITE) if (files(nf) == ERR) call cant(buf) } while(getc(c) != EOF) { call putch(c,STDOUT) for (i=1; i<=nf; i=i+1) call putch(c, files(i)) } DRETURN end #-h- tee.rof 612 asc 11-may-81 12:15:03 [002,100] .pl 60 .bp .rm 70 .in 0 .he 'TEE'1/11/79'TEE' .fo ''-#-' .fi NAME .br .in 7 tee - copy input to standard output and named files .sp 1 .in SYNOPSIS .br .in 7 tee [file] ... .sp 1 .in DESCRIPTION .br .in 7 Tee copies the standard input to the standard output and makes copies in the named files. .sp 1 .in FILES .br .in 7 .sp 1 .in SEE ALSO .br .in 7 The tool 'cat'; the tool 'crt'; the Unix command 'tee' .sp 1 .in DIAGNOSTICS .br .in 7 A message is printed if the input file cannot be opened. .sp 1 .in AUTHORS .br .in 7 .sp 1 Debbie Scherrer .sp 1 .in BUGS .br .in 7