From owner-freebsd-questions Wed Apr 11 22: 2: 8 2001 Delivered-To: freebsd-questions@freebsd.org Received: from chmod.ath.cx (CC2-861.charter-stl.com [24.217.115.99]) by hub.freebsd.org (Postfix) with ESMTP id 51B1637B443 for ; Wed, 11 Apr 2001 22:02:02 -0700 (PDT) (envelope-from ajh3@chmod.ath.cx) Received: by chmod.ath.cx (Postfix, from userid 1001) id 2B50EA91E; Thu, 12 Apr 2001 00:01:21 -0500 (CDT) Date: Thu, 12 Apr 2001 00:01:21 -0500 From: Andrew Hesford To: Andrew Johns Cc: freebsd-questions@freebsd.org Subject: Re: How to:Read directly from serial port to a file Message-ID: <20010412000121.B8789@cec.wustl.edu> References: <3AD52F5E.BDED3F1C@kpi.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3AD52F5E.BDED3F1C@kpi.com.au>; from johnsa@kpi.com.au on Thu, Apr 12, 2001 at 02:30:22PM +1000 X-Loop: Andrew Hesford Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 & in tcsh, which will keep the program writing to the log without it being in the forground. -- Andrew Hesford ajh3@chmod.ath.cx To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message