From owner-freebsd-questions Mon Jul 29 14:22:32 2002 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 A0D5D37B400 for ; Mon, 29 Jul 2002 14:22:27 -0700 (PDT) Received: from cypress.adhesivemedia.com (cypress.adhesivemedia.com [207.202.159.72]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05EA543E4A for ; Mon, 29 Jul 2002 14:22:27 -0700 (PDT) (envelope-from philip@adhesivemedia.com) Received: from cypress.adhesivemedia.com (localhost [127.0.0.1]) by cypress.adhesivemedia.com (8.12.3/8.12.3) with ESMTP id g6TLMKdq072501; Mon, 29 Jul 2002 14:22:20 -0700 (PDT) (envelope-from philip@adhesivemedia.com) Received: from localhost (philip@localhost) by cypress.adhesivemedia.com (8.12.3/8.12.3/Submit) with ESMTP id g6TLMKYj072498; Mon, 29 Jul 2002 14:22:20 -0700 (PDT) X-Authentication-Warning: cypress.adhesivemedia.com: philip owned process doing -bs Date: Mon, 29 Jul 2002 14:22:20 -0700 (PDT) From: Philip Hallstrom To: "Christopher J. Umina" Cc: Oliver Humpage , FreeBSD Question Mailing List Subject: Re: matching a string In-Reply-To: <20020729172106.G1289-100000@216-164-225-145.c3-0.wth-ubr2.sbo-wth.ma.cable.rcn.com> Message-ID: <20020729142202.H71705-100000@cypress.adhesivemedia.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Try using 's/^[^;]; \[//' as the first pattern. On Mon, 29 Jul 2002, Christopher J. Umina wrote: > when I run that this is my output even when I add the .+: > > Sun Jul 07, 2002 at 17:10:03; [kelzy16 > Mon Jul 08, 2002 at 17:17:12; [cc skillet > Wed Jul 10, 2002 at 17:53:41; [ccgirl436 > Wed Jul 10, 2002 at 17:53:41; [ccgirl436 > Thu Jul 11, 2002 at 16:58:31; [meikman99 > Mon Jul 15, 2002 at 17:43:50; [bctictac8 > Thu Jul 18, 2002 at 22:07:46; [superman lmd 69 > Thu Jul 18, 2002 at 23:22:15; [russh2112 > Thu Jul 18, 2002 at 23:22:27; [russh2112 > Fri Jul 19, 2002 at 15:37:14; [lauren md 6 9 > Fri Jul 19, 2002 at 16:36:06; [alldayyesterday > Fri Jul 19, 2002 at 16:47:38; [fritzilldo > Fri Jul 19, 2002 at 16:47:40; [beth42085 > Sun Jul 21, 2002 at 19:17:59; [mastahuy85 > Mon Jul 22, 2002 at 08:47:52; [dublindamien > Mon Jul 22, 2002 at 10:23:17; [adarc22 > Mon Jul 22, 2002 at 10:23:28; [adarc22 > Mon Jul 22, 2002 at 10:23:56; [adarc22 > Mon Jul 22, 2002 at 23:42:21; [katsie236 > Tue Jul 23, 2002 at 22:19:23; [e is happy > Wed Jul 24, 2002 at 19:04:14; [ilaughatyourlife > Thu Jul 25, 2002 at 08:58:54; [adarc22 > Fri Jul 26, 2002 at 14:40:06; [devilchik205 > Fri Jul 26, 2002 at 15:43:55; [alldayyesterday > Fri Jul 26, 2002 at 22:18:51; [reggie645 > Fri Jul 26, 2002 at 22:36:57; [reggie645 > Fri Jul 26, 2002 at 23:29:28; [sllissa85 > Fri Jul 26, 2002 at 23:37:35; [jea9f2oo3 > Fri Jul 26, 2002 at 23:49:17; [reggie645 > Fri Jul 26, 2002 at 23:50:21; [reggie645 > Fri Jul 26, 2002 at 23:51:29; [reggie645 > Fri Jul 26, 2002 at 23:51:56; [reggie645 > Fri Jul 26, 2002 at 23:54:01; [reggie645 > Sat Jul 27, 2002 at 17:04:16; [meikman99 > Sun Jul 28, 2002 at 10:08:09; [bctictac8 > Sun Jul 28, 2002 at 10:39:36; [e is happy > Sun Jul 28, 2002 at 23:15:38; [babygurl2835 > Sun Jul 28, 2002 at 23:17:05; [babygurl2835 > > > On Mon, 29 Jul 2002, Oliver Humpage wrote: > > > > > On Mon, 29 Jul 2002, Philip Hallstrom wrote: > > > > > Something like... > > > > > > sed -e 's/^; \[//' -e 's/].*//' logfile > > > > > > should work... I'm sure there are lots of other ways to do it as well. > > > > Wouldn't you need to make the first bit: > > > > 's/^.+; \[//' > > ^^ > > ? > > > > Apart from that, thanks for a demonstration of sed's -e flag, I didn't > > realise it did that :) > > > > Oliver. > > > > (PS This won't get posted to the list, since reverse IP lookup ain't > > working...) > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message