From owner-freebsd-questions@FreeBSD.ORG Fri Aug 13 16:37:18 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 EA2AD10656BB for ; Fri, 13 Aug 2010 16:37:18 +0000 (UTC) (envelope-from marktinguely@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id A0AA58FC08 for ; Fri, 13 Aug 2010 16:37:18 +0000 (UTC) Received: by gwj23 with SMTP id 23so1270739gwj.13 for ; Fri, 13 Aug 2010 09:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=M3DSqKALYFS+EimAvBh6tC9GmIeoUqaed+y0CNBMlr0=; b=wCZw23zN4AAoQwlxpW9sJQc+ryrPwd4tRM58IvtOnVq+a0uAiisk/uUsSxAza59J06 paex+K8rw9EWkJrkpD2ZNFzmSYGxCDnZ59LF0cIPzH+G2btpzOC3XuvVSAcWgrvBC8t5 pYEol6iqxpR77gR7c6fwSA9gF1QgeZ6I3XTZY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=yEn+R8naMr6JJX8AE3l0FzNiAIuDA3cd6uugtAs+XKcAjvEwJY4Jasb6Pyf34GRxIn VK7o/iOg5gPfEEUct1107psIOYTaewqBBbNZ9XgO3+300hj6JpF6KKCNP3Fkh3QCiqMh LyyIsgMEGxO8RQZLZeGPzMb4NZ5gdfWR+nH5Q= Received: by 10.100.191.20 with SMTP id o20mr2170998anf.18.1281716049898; Fri, 13 Aug 2010 09:14:09 -0700 (PDT) Received: from [192.168.0.100] (71-38-48-15.frgo.qwest.net [71.38.48.15]) by mx.google.com with ESMTPS id e8sm1434083ibb.14.2010.08.13.09.14.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 13 Aug 2010 09:14:09 -0700 (PDT) Message-ID: <4C656F4B.2070304@gmail.com> Date: Fri, 13 Aug 2010 11:14:03 -0500 From: Mark Tinguely User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: lconrad@Go2France.com References: <201008131723.AA679149726@mail.Go2France.com> In-Reply-To: <201008131723.AA679149726@mail.Go2France.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: awk problem 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, 13 Aug 2010 16:37:19 -0000 Len Conrad wrote: > 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 > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > > How about: awk -F. '{ print $(NF-1)"."$NF }'