Everhart,Glenn From: Dan Sugalski [sugalskd@osshe.edu] Sent: Tuesday, March 31, 1998 4:58 PM To: Info-VAX@Mvb.Saic.Com Subject: Re: PIPE, but no TEE? At 06:51 PM 3/31/1998 GMT, mathog@seqaxp.bio.caltech.edu wrote: >In OpenVMS 7.1 there is a PIPE, but no TEE. Will it be implemented in >7.2 (or later)? If not, how do you do the equivalent of this: > >psx> make -f makefile | tee make_vms.com > >(Which I use very frequently for porting Unix -> VMS). > >That is, echo it in real time to the terminal AND record output in a file. Hmmm. How 'bout this (off the top of my head, and not actually tested): /* tee.c - do a unix-style tee */ #include #include void main(int argc, char *argv) { FILE *TeeFile; char InputLine[4096]; /* open the tee file */ TeeFile = fopen(argv[0], "w"); /* grab lines until we have no more */ while (gets(InputLine)) { puts(InputLine); fputs(InputLine, TeeFile); fputc('\n', TeeFile); } fclose(TeeFile); } Dan ---------------------------------------------"it's like this"-------------- Dan Sugalski (541) 737-3346 even samurai SysAdmin have teddy bears Oregon University System and even the teddy bears sugalskd@ous.edu get drunk