using tee program with tar output
Jonathan I. Kamens
jik at athena.mit.edu
Sat May 11 00:17:51 AEST 1991
In article <26840 at adm.brl.mil>, sean at dmr.asa.com (Sean Baker) writes:
|> I'm trying to redirect the output of tar to a file.
|>
|> I can do this fine in the csh by using:
|>
|> tar cvf tarfile /tmp |& tee tar.out
|>
|> But how do I do this with the Bourne shell? I can't seem to
|> get both stdin and stdout sent to the tee program?
Your question is very confused.
If you are asking how to direct both the standard output and the standard
error of a command to a file, which is what the "tar" example you gave does,
in the bourne shell, then the last bit about "stdin and stdout" does not
belong. The answer to the question, in any case, is "tar cvf tarfile 2>&1 |
tee tar.out". See the man page for sh.
If you are asking how to record both what is typed at a command and what is
printed by it as output, then the part of your question about "stdin and
stdout" makes sense, but the first part of it does not, because the tar
command you gave does NOT do that. In any case, the answer to the question is
to use something like "script" which will record a login session.
--
Jonathan Kamens USnail:
MIT Project Athena 11 Ashford Terrace
jik at Athena.MIT.EDU Allston, MA 02134
Office: 617-253-8085 Home: 617-782-0710
More information about the Comp.unix.questions
mailing list