From owner-freebsd-questions Wed Apr 11 22:36: 1 2001 Delivered-To: freebsd-questions@freebsd.org Received: from www.kpi.com.au (www.kpi.com.au [203.39.132.210]) by hub.freebsd.org (Postfix) with ESMTP id C505537B424 for ; Wed, 11 Apr 2001 22:35:51 -0700 (PDT) (envelope-from johnsa@kpi.com.au) Received: from kpi.com.au (localhost.kpi.com.au [127.0.0.1]) by www.kpi.com.au (8.9.3/8.9.3) with ESMTP id PAA27877; Thu, 12 Apr 2001 15:35:22 +1000 (EST) (envelope-from johnsa@kpi.com.au) Message-ID: <3AD53EAF.27C1D7FC@kpi.com.au> Date: Thu, 12 Apr 2001 15:35:43 +1000 From: Andrew Johns Organization: Deloitte Touche Tohmatsu X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Andrew Hesford Cc: freebsd-questions@freebsd.org Subject: Re: How to:Read directly from serial port to a file References: <3AD52F5E.BDED3F1C@kpi.com.au> <20010412000121.B8789@cec.wustl.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Andrew Hesford wrote: > On Thu, Apr 12, 2001 at 02:30:22PM +1000, Andrew Johns wrote: > > Apologies for following up my own post. > > > > 2 additional things: > > a) Please CC me (too many subscriptions already) > > b) The command I've been trying is: > > # cu -l /dev/cuaa2 -s 1200 > phonelog > > # > > > > but I get: > > [1] + Suspended (tty output) cu -l /dev/cuaa2 -s 1200 > > > > I can do the cu -l ...... manually and then pipe the output using > > ~| cat - phonelog > > from within cu, but I neeed to be able to start this from rc.d startup > > script > > Okay, suspending it isn't the same as backgrounding it. By pressing ^Z > to suspend, you're telling the program to freeze where it is. > > To background a process at runtime, you need to run the command: > > cu -l /dev/cuaa2 -s 1200 > phonelog & > > > which will tell the program to continue to run in the background, > without showing you stdout (since you redirected it). Note that stderr, > which has not been redirected, will still get dumped to whatever console > you started this in. > > To redirect stderr, you change the ">" to ">&" in tcsh, or "&>" in bash. > Thus you get: > > cu -l /dev/cuaa2 -s 1200 >& phonelog & That is eactly what I was doing (sorry I chopped the & off in the email). The result is identical: [logger:ttyp0:~] [0] Yes Master # cu -l /dev/cuaa2 -s 1200 >& phonelog & [1] 493 [logger:ttyp0:~] [0] Yes Master # <- Enter on a line by itself [1] + Suspended (tty output) cu -l /dev/cuaa2 -s 1200 >& phonelog -- aj To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message