From owner-freebsd-questions@FreeBSD.ORG Fri Sep 15 05:23:44 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D9FA816A403 for ; Fri, 15 Sep 2006 05:23:44 +0000 (UTC) (envelope-from davidschulz@tca-cable-connector.com) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.183]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3333E43D45 for ; Fri, 15 Sep 2006 05:23:43 +0000 (GMT) (envelope-from davidschulz@tca-cable-connector.com) Received: from [218.16.58.208] (helo=munin.tcaportal.com) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis), id 0ML21M-1GO6Au45V4-0002iL; Fri, 15 Sep 2006 07:23:43 +0200 Received: from localhost (localhost.tcaportal.com [127.0.0.1]) by munin.tcaportal.com (Postfix) with SMTP id 849D1A6C30 for ; Fri, 15 Sep 2006 13:23:02 +0800 (HKT) Received: from [10.0.1.102] (loki.tcaportal.com [10.0.1.102]) by munin.tcaportal.com (Postfix) with ESMTP id 29B48A6C2E for ; Fri, 15 Sep 2006 13:23:01 +0800 (HKT) Mime-Version: 1.0 (Apple Message framework v752.2) Content-Transfer-Encoding: 7bit Message-Id: <3479C24E-BC58-4F21-91D2-03E2B948EAED@tca-cable-connector.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: FreeBSD Users Questions From: David Schulz Date: Fri, 15 Sep 2006 13:23:32 +0800 X-Mailer: Apple Mail (2.752.2) X-Provags-ID: kundenserver.de abuse@kundenserver.de login:1405312fe15d228f5bad0d2fcbb6dc17 Subject: Piping output from serial device to file does not want to work X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 05:23:44 -0000 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 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