Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Sep 2006 13:23:32 +0800
From:      David Schulz <davidschulz@tca-cable-connector.com>
To:        FreeBSD Users Questions <freebsd-questions@freebsd.org>
Subject:   Piping output from serial device to file does not want to work
Message-ID:  <3479C24E-BC58-4F21-91D2-03E2B948EAED@tca-cable-connector.com>

next in thread | raw e-mail | index | archive | help
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     Time    Ext CO        Dial Number        Ring Duration   
Acc code  CD

------------------------------------------------------------------------ 
--------

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

09/15/06 11:27AM  8036 05 <I>                       0'00  
00:30'17            TR
----->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'00            TR
09/15/06 11:17AM  8072 13 17909013923793510               
00:00'00            TR
09/15/06 11:17AM  8072 13 17909013923793510               
00:00'00            TR
09/15/06 11:17AM  8072 13 17909013923793510               
00:00'00            TR
----->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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3479C24E-BC58-4F21-91D2-03E2B948EAED>