From owner-freebsd-questions@FreeBSD.ORG Mon Mar 6 21:45:49 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 42BC716A420 for ; Mon, 6 Mar 2006 21:45:49 +0000 (GMT) (envelope-from noeldude@gmail.com) Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4A7143DC6 for ; Mon, 6 Mar 2006 21:45:48 +0000 (GMT) (envelope-from noeldude@gmail.com) Received: by nproxy.gmail.com with SMTP id n29so903495nfc for ; Mon, 06 Mar 2006 13:45:47 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=G5RnYIiEdVjDN9r1OjEwBGn12IDbko6lzdGADZ4UKOOAvref+H+sUciwNJtIM1F1sckGJe/Ph025dpZ8mcRg+ijV0O30o7QWTD+Khl+g7fd0tbVIsiNmKMFTBiZMIZ1lFxoANtdZaWdaOOfwQs9IeobZzv9EG7Fk3P7eGjNyPNE= Received: by 10.48.225.15 with SMTP id x15mr2612917nfg; Mon, 06 Mar 2006 13:45:47 -0800 (PST) Received: by 10.49.31.6 with HTTP; Mon, 6 Mar 2006 13:45:47 -0800 (PST) Message-ID: Date: Mon, 6 Mar 2006 15:45:47 -0600 From: "Noel Jones" To: "freebsd-questions Questions list" In-Reply-To: <75a11e816bee8f2664ae1ccbd618dca7@athensasd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <75a11e816bee8f2664ae1ccbd618dca7@athensasd.org> 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: Mon, 06 Mar 2006 21:45:49 -0000 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 -- Noel Jones