Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Mar 2002 17:32:32 +0000
From:      Scott Mitchell <scott.mitchell@mail.com>
To:        mmercer@nc.rr.com, mmercer@lboard.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Bourne shell question: How to capture stdin and stdout from bourne shell script.
Message-ID:  <20020323173232.F278@fishballoon.dyndns.org>
In-Reply-To: <3C9C9D1B.93CDBC8F@nc.rr.com>; from mmercer@nc.rr.com on Sat, Mar 23, 2002 at 10:19:55AM -0500
References:  <3C9BF45E.BBEB5911@nc.rr.com> <20020323034432.GA9544@raggedclown.net> <3C9BFC12.F6C1C22C@nc.rr.com> <20020323105840.B278@fishballoon.dyndns.org> <3C9C9D1B.93CDBC8F@nc.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
[cc-ing to -questions, for the benefit of the archives]

On Sat, Mar 23, 2002 at 10:19:55AM -0500, Michael E Mercer wrote:
> Can you explain exactly how this works? I need to capture the output of the script
> and
> the input of the user in a log file.
> 
> Thanks
> Michael Mercer

Ahhh, I think I spoke too quickly before :-(

The exec trick won't capture the input for you, just redirect it from a
file rather than the terminal.  It's exactly the same as specifying I/O
redirections on the command line, except that they're embedded in the
script.

I think your other suggestion, of setting $SHELL so that script runs your
program rather than a shell, will do what you need though.

Apologies for the confusion.

	Scott

-- 
===========================================================================
Scott Mitchell          | PGP Key ID | "Eagles may soar, but weasels
Cambridge, England      | 0x54B171B9 |  don't get sucked into jet engines"
scott.mitchell@mail.com | 0xAA775B8B |      -- Anon

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020323173232.F278>