From owner-freebsd-questions@FreeBSD.ORG Tue Mar 7 13:53:37 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 4930C16A420 for ; Tue, 7 Mar 2006 13:53:37 +0000 (GMT) (envelope-from bsilver@chrononomicon.com) Received: from trans-warp.net (hyperion.trans-warp.net [216.37.208.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6B1E543D53 for ; Tue, 7 Mar 2006 13:53:36 +0000 (GMT) (envelope-from bsilver@chrononomicon.com) Received: from [127.0.0.1] (unverified [65.193.73.208]) by trans-warp.net (SurgeMail 3.7a) with ESMTP id 45475929 for multiple; Tue, 07 Mar 2006 08:53:32 -0500 In-Reply-To: References: <75a11e816bee8f2664ae1ccbd618dca7@athensasd.org> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <551fa2ce1b8832dd3370d0e781c5b301@chrononomicon.com> Content-Transfer-Encoding: quoted-printable From: Bart Silverstrim Date: Tue, 7 Mar 2006 08:53:32 -0500 To: "Noel Jones" X-Mailer: Apple Mail (2.623) X-Server: High Performance Mail Server - http://surgemail.com r=-1980812739 X-Authenticated-User: bsilver@chrononomicon.com Cc: freebsd-questions Questions list Subject: Re: awk question 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: Tue, 07 Mar 2006 13:53:37 -0000 On Mar 6, 2006, at 4:45 PM, Noel Jones wrote: > On 3/6/06, Bart Silverstrim wrote: >> I'm totally drawing a blank on where to start out on this. >> >> If I have a list of URLs like >> http://www.happymountain.com/archive/digest.gif >> >> How could I use Awk or Sed to strip everything after the .com? Or is >> there a "better" way to do it? I'd like to just pipe the information >> from the logs to this mini-script and end up with a list of URLs >> consisting of just the domain (http://www.happymountain.com). >> > > > | cut -d / -f 1-3 Oh boy was that one easy. It was a BAD mental hiccup. I'll add a sort and uniq and it should be all ready to go. =10Thanks!