Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!lsuc!dave From: dave@lsuc.UUCP Newsgroups: comp.unix.wizards Subject: Re: Redirecting shell output. Message-ID: <2088@lsuc.UUCP> Date: Mon, 19-Oct-87 22:23:48 EDT Article-I.D.: lsuc.2088 Posted: Mon Oct 19 22:23:48 1987 Date-Received: Tue, 20-Oct-87 21:01:52 EDT References: <289@minya.UUCP> Organization: Law Society of Upper Canada, Toronto Lines: 21 Summary: exec sh <<'NEVER_HAPPENS' >file In article <289@minya.UUCP>, jc@minya.UUCP (John Chambers) writes: > Is there a "right" way > to tell the shell to redirect the output of ALL subsequent commands to a > file? We ran into this when running stuff at startup from /etc/rc (on a v7-based system, not that it matters). I found all those ">/dev/console"s a bit ugly. Mark Brader, {lsuc,sq}!msb suggested: exec sh <<'_UNTIL_THE_END_OF_THIS_FILE_' >/dev/console 2>&1 which we've been using for years now. Note that sh doesn't ever need to find the _UNTIL_etc. string; if it encounters EOF it exits happily. David Sherman The Law Society of Upper Canada Toronto -- { uunet!mnetor pyramid!utai decvax!utcsri ihnp4!utzoo } !lsuc!dave Pronounce it ell-ess-you-see, please...