Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Apr 2001 00:01:21 -0500
From:      Andrew Hesford <ajh3@chmod.ath.cx>
To:        Andrew Johns <johnsa@kpi.com.au>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to:Read directly from serial port to a file
Message-ID:  <20010412000121.B8789@cec.wustl.edu>
In-Reply-To: <3AD52F5E.BDED3F1C@kpi.com.au>; from johnsa@kpi.com.au on Thu, Apr 12, 2001 at 02:30:22PM %2B1000
References:  <3AD52F5E.BDED3F1C@kpi.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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