From owner-freebsd-questions@FreeBSD.ORG Fri Aug 13 15:53:28 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAAE01065679 for ; Fri, 13 Aug 2010 15:53:28 +0000 (UTC) (envelope-from lconrad@Go2France.com) Received: from mgw1.MEIway.com (mgw1.meiway.com [81.255.84.75]) by mx1.freebsd.org (Postfix) with ESMTP id 82C998FC12 for ; Fri, 13 Aug 2010 15:53:25 +0000 (UTC) Received: from VirusGate.MEIway.com (virusgate.meiway.com [81.255.84.76]) by mgw1.MEIway.com (Postfix Relay Hub) with ESMTP id 89D7C471870 for ; Fri, 13 Aug 2010 17:23:08 +0200 (CEST) Received: from mail.Go2France.com (ms1.meiway.com [81.255.84.73]) by VirusGate.MEIway.com (Postfix) with ESMTP id DD8383865B6 for ; Fri, 13 Aug 2010 17:23:08 +0200 (CEST) (envelope-from lconrad@Go2France.com) Date: Fri, 13 Aug 2010 17:23:06 +0200 Message-Id: <201008131723.AA679149726@mail.Go2France.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii From: "Len Conrad" X-Sender: To: X-Mailer: Subject: awk problem X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: lconrad@Go2France.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Aug 2010 15:53:28 -0000 I readfile or pipe this text, in any line order: rm90.steampick.info fgce172.lanejive.info smailer1.service.govdelivery.com fl49.orangetalon.info pollux.carespecial.info into a program to remove subdomains down to domain.tld : awk 'FS="." { print $(NF-1)"."$NF }' and get the first line doubled rather than processed like the other lines: rm90.steampick.info.rm90.steampick.info lanejive.info govdelivery.com orangetalon.info carespecial.info thanks Len