Piping stderr in Korn and/or Bourne shell

Maarten Litmaath maart at cs.vu.nl
Sat Apr 7 16:21:26 AEST 1990


In article <12541 at smoke.BRL.MIL>,
	gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
)...
)>I want to pipe stderr to this program WITHOUT piping stdin as well.
)...
)(writes_on_stderr_and_stdout 9>&1 2>&1 1>&- | cat >stderr) 1>&9 | cat >stdout

Doesn't work.  Instead try:

	$ cat foo
	echo stdout
	echo stderr >&2
	$ (sh foo 2>&1 1>&9 | cat > stderr) 9>&1 | cat > stdout
Or:
	$ sh foo 2>&1 > stdout | cat > stderr
--
 1) Will 4.5BSD have wait5()?         |Maarten Litmaath @ VU Amsterdam:
 2) Sleep(3) should be sleep(2) again.|maart at cs.vu.nl, uunet!mcsun!botter!maart



More information about the Comp.unix.questions mailing list