Re: Piping output from serial device to file does not want to work

2006-09-14 Thread Matthias Apitz
El día Friday, September 15, 2006 a las 01:23:32PM +0800, David Schulz escribió:

...
> 
> So using this command : egrep  -v -e "\---|^$|Date" -D read /dev/ 
> cuad0 , works, and puts out the data to stdout for me to see, but  
> when i want to pipe it to a file, using egrep  -v -e "\---|^$|Date" - 
> D read /dev/cuad0 >> logfile , then never any data appears in the  
> logfile. Can anyone tell me wht that is, and maybe suggest a better  
> way to do this?

The data is in the output buffer of egrep's STDOUT and not written
until EOF on STDIN (which perhaps will never occur) or until certain
bufsize is reached; you may use the flag '--line-buffered' of egrep;

matthias

-- 
Matthias Apitz
Manager Technical Support - OCLC PICA GmbH
Gruenwalder Weg 28g - 82041 Oberhaching - Germany
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e <[EMAIL PROTECTED]> - w http://www.oclcpica.org/ http://guru.UnixLand.de/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Piping output from serial device to file does not want to work

2006-09-14 Thread David Schulz

Hello,

Data coming from /dev/cuad0 looks like this when read using cat /dev/ 
cuad0 :


->Snippet start
09/15/06 11:17AM  8003 13 17909013923793510  00:10'58

  Date TimeExt CODial NumberRing Duration   
Acc code  CD


 



09/15/06 11:17AM  8072 13 17909013923793510   
00:00'00TR


09/15/06 11:27AM  8036 050'00  
00:30'17TR

->Snipped end

Now i would like to strip away the blank lines, the line with Date,  
and the ---Line and then pipe it to a logfile, so the output looks like


->Snippet start
09/15/06 11:17AM  8072 13 17909013923793510   
00:00'00TR
09/15/06 11:17AM  8072 13 17909013923793510   
00:00'00TR
09/15/06 11:17AM  8072 13 17909013923793510   
00:00'00TR
09/15/06 11:17AM  8072 13 17909013923793510   
00:00'00TR

->Snipped end

So using this command : egrep  -v -e "\---|^$|Date" -D read /dev/ 
cuad0 , works, and puts out the data to stdout for me to see, but  
when i want to pipe it to a file, using egrep  -v -e "\---|^$|Date" - 
D read /dev/cuad0 >> logfile , then never any data appears in the  
logfile. Can anyone tell me wht that is, and maybe suggest a better  
way to do this?


Thanks a lot,
David

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"