From owner-freebsd-questions@FreeBSD.ORG Fri Aug 13 16:36:49 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 160F11065697 for ; Fri, 13 Aug 2010 16:36:49 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id C01B28FC14 for ; Fri, 13 Aug 2010 16:36:48 +0000 (UTC) Received: by yxe42 with SMTP id 42so1276451yxe.13 for ; Fri, 13 Aug 2010 09:36:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=N/01VQtIVKBH5MM9eIPIN0Yi3d9nqZFT+MGfFEd1wlE=; b=CoHFPiGI73v58A4xeVSRtsaoHJWqaOSBTpNSiD8yFIo310PgcUu/9XLyIJjgoPaGDy LbsAPoi5ZwtpBb25yVQlrTYhR6uFC1yq1zvNr1dGR3PBbHlgj3sbzs2dwW3SBH2KtSqt i1YD7Ms8I8GxsKiEJrkTpwOQcyPvGK1z8UwY0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=sYheYFIT67L5D+4pwjkVXf25LtMvzT73YJFy0C05wZtUZkjMbeWL+yQLXVV3zulAPE YnNrE6+czcpEs9UYN/JBM9hCCa8137cppGelNckI3bAEEKR2ji/nR4IdwEDvMmzdi9i9 HxoRwWQW2Pqjh3dAtdkMTlUbui/au1fEoHASY= Received: by 10.101.107.8 with SMTP id j8mr2136761anm.166.1281717406470; Fri, 13 Aug 2010 09:36:46 -0700 (PDT) Received: from localhost (gpftor6.privacyfoundation.de [62.212.67.209]) by mx.google.com with ESMTPS id o7sm1013632vcn.5.2010.08.13.09.36.40 (version=SSLv3 cipher=RC4-MD5); Fri, 13 Aug 2010 09:36:45 -0700 (PDT) From: Anonymous To: merlyn@stonehenge.com (Randal L. Schwartz) References: <201008131723.AA679149726@mail.Go2France.com> <8639uipjdv.fsf@red.stonehenge.com> Date: Fri, 13 Aug 2010 20:36:24 +0400 In-Reply-To: <8639uipjdv.fsf@red.stonehenge.com> (Randal L. Schwartz's message of "Fri, 13 Aug 2010 09:28:12 -0700") Message-ID: <8639uiwjuf.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: lconrad@Go2France.com, 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:36:49 -0000 merlyn@stonehenge.com (Randal L. Schwartz) writes: > Len> awk 'FS="." { print $(NF-1)"."$NF }' > > Len> rm90.steampick.info.rm90.steampick.info > Len> lanejive.info > Len> govdelivery.com > Len> orangetalon.info > Len> carespecial.info > > Yes, that would be the expected behavior. > > You need to set the FS *before* processing the first line. > > Either use -F ., or a BEGIN block. Then it's already fixed in 8.1-RELEASE by update in r201951. contrib/one-true-awk/FIXES: Nov 26, 2009: fixed a long-standing issue with when FS takes effect. a change to FS is now noticed immediately for subsequent splits.