Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Apr 2001 15:35:43 +1000
From:      Andrew Johns <johnsa@kpi.com.au>
To:        Andrew Hesford <ajh3@chmod.ath.cx>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to:Read directly from serial port to a file
Message-ID:  <3AD53EAF.27C1D7FC@kpi.com.au>
References:  <3AD52F5E.BDED3F1C@kpi.com.au> <20010412000121.B8789@cec.wustl.edu>

next in thread | previous in thread | raw e-mail | index | archive | help


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3AD53EAF.27C1D7FC>