Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!purdue!tut.cis.ohio-state.edu!rutgers!att!ihlpy!wolfordj From: wolfordj@ihlpy.ATT.COM (452is-Wolford) Newsgroups: comp.sources.wanted Subject: Re: script for SYS V Message-ID: <12637@ihlpy.ATT.COM> Date: 1 May 89 21:24:11 GMT References: <8311@chinet.chi.il.us> Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 44 From article <8311@chinet.chi.il.us>, by gag@chinet.chi.il.us (Gregory A. Gulik): > Does anyone have source for a 'script' like program for > SYS V? I've seen it on BSD systems, but I can't > find the equivalent on SYS V. > > Thanks, > > greg > > > -- > Gregory A. Gulik > gag@chinet.chi.il.us > -or- > gulik@depaul.edu The easiest was is to do a "tee | sh prog | tee" with some options here is what I use: tee -i -a file.log | sh prog | tee -i -a file.log the -i causes interrupts to be ignored, end tee with a ^D and the -a says to append to the log file. The first tee makes a copy of standard in and passes it along as input to prog, the second tee takes the output, makes a copy and sends it to std out (usualy the terminal). The "sh prog" is if the prog needs to run under a different shell than you are currently running. If the current shell you are running is ok, then skip the "sh" part of the "sh prog". This will work in UN*X System V Release 2.0, 3.0, 3.1 and 3.2. As always, questions send mail to: Jeff Wolford att!iwsag!jww att!ihlpy!wolfordj harvard-+ | ucbvax--+---- att --+ iwsag!jww | decvax--+