Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!cmcl2!rna!dan From: dan@rna.UUCP Newsgroups: comp.unix.questions Subject: Re: Stupid shell I/O redirection question... Message-ID: <614@rna.UUCP> Date: Mon, 23-Feb-87 23:10:45 EST Article-I.D.: rna.614 Posted: Mon Feb 23 23:10:45 1987 Date-Received: Thu, 26-Feb-87 23:24:49 EST References: <612@rna.UUCP> Organization: Rockefeller Neurobiology Lines: 26 > I have a shell script which issues commands that generate output on > both the stdout and stderr (1 and 2). I want to redirect both stdout and stderr To partially answer my own question, upon further experimentation, it does appear that cmd 2>&1 | tee log does do what I wanted. I was trying, time date 2>&1 | tee log which doesn't work. But I think that is because "time" is built into the Korn shell that I am using. Only (time date 2>&1) | tee log works, although /bin/time date 2>&1 | tee log also works. Which brings up the even more stupid question of how do you control when the dup() occurs. Suppose you DID want the stderr to be the OLD stdout and the NEW stdout to be the pipe. (why, well...)