From owner-freebsd-questions@freebsd.org Sat Apr 8 19:11:33 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D88DD34E1C for ; Sat, 8 Apr 2017 19:11:33 +0000 (UTC) (envelope-from andipersti@gmail.com) Received: from mail-wr0-x230.google.com (mail-wr0-x230.google.com [IPv6:2a00:1450:400c:c0c::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0BB98EA for ; Sat, 8 Apr 2017 19:11:32 +0000 (UTC) (envelope-from andipersti@gmail.com) Received: by mail-wr0-x230.google.com with SMTP id c55so53080737wrc.3 for ; Sat, 08 Apr 2017 12:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=8gVdR639uQd44fDBWjImZJqbxXcIio8LOng/PG3RBTM=; b=gvx8BE3UsKEE1eyyyQp9mZqMcM7W9X9cg4aZJVGDoEXEiiluPR1o7D1tWO80zXjnFu t67/zgqt0K+zWAaBiDKwUHXtqxMyZNuvfN4hCDV3hVMWwIWeXGLgYD+uHCVrZHKA41XH EgQaBXLBBTW6bcscfNhovlzYm9vsx/UaFynObGt/hyulnaOszrO0yuwtQdwBUbC3T/gJ qALr4uUweiS/KRXojn8JRuJx5kikr68cyio0oPx82trzEByMKRf2bhKV4wQgIQObjkxE 6uKeRhI7jHwIk/YRSX5CLEwgLCmA/JiCK1SNghWVSy6ZNxESfBwUgpKrQZspS+vHsbrF wV1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=8gVdR639uQd44fDBWjImZJqbxXcIio8LOng/PG3RBTM=; b=VJvfxcOsEc1LyOWCc+DmvMA+16LtbMNMzVaxEz0Xw+5QUbvtwrT0QYhOnVTC83v1DW ojDbbcuq+KKHUZnLMeLLPD/nY1nHxeLgbURSDcztMrxvkdlHefCTityFYcpeMTLlEUag EQQ9zFvDfu8wGKvuEp/+iRIS4XpCqtHpRzHWRLKTFgb7TccOAnVx/yA1ePG3KPKt69g6 AK2oFHCnMwwPzRQKdtYc5OSKWTPDxEs2MT+dOoPuHJVNubyi9NVCJdZCMBFf2TsXcesK kPaT2Evx4zcAMD3RnZaC80ALe8WWyv2BW5SSydfZxjutE9DaYX/rGPUtH72PFfmjtgO0 6MBQ== X-Gm-Message-State: AFeK/H3u0J26dgMnvmxUm8wOjkeiHDFxWEB696uYW3yg5E76rOpW+EXW/vmShV6NOF/9pw== X-Received: by 10.223.178.66 with SMTP id y2mr41429636wra.161.1491678689702; Sat, 08 Apr 2017 12:11:29 -0700 (PDT) Received: from [192.168.178.25] (91-119-212-211.dsl.dynamic.surfer.at. [91.119.212.211]) by smtp.googlemail.com with ESMTPSA id v186sm3724014wmv.2.2017.04.08.12.11.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Apr 2017 12:11:29 -0700 (PDT) Subject: Re: Is there a database built into the base system To: freebsd-questions@freebsd.org References: <58E696BD.6050503@gmail.com> <69607026-F68C-4D9D-A826-3EFE9ECE12AB@mac.com> <58E69E59.6020108@gmail.com> <20170406210516.c63644064eb99f7b60dbd8f4@sohara.org> <58E6AFC0.2080404@gmail.com> <20170407001101.GA5885@tau1.ceti.pl> <20170407210629.GR2787@mailboy.kipshouse.net> <58E83E19.8010709@gmail.com> <20170408145503.69ddf649@gumby.homeunix.com> <58E9171F.3060405@gmail.com> <20170408191633.70d1f303.freebsd@edvax.de> <58E91F4D.90005@gmail.com> From: Andreas Perstinger Message-ID: Date: Sat, 8 Apr 2017 21:11:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <58E91F4D.90005@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Apr 2017 19:11:33 -0000 On 2017-04-08 19:35, Ernie Luzar wrote: > I though "end" was end of line not end of file. So how should that awk > command look to drop dups from the out put file? A simple one-liner would be awk '{ if ($1 != prev_ip) {print $1; prev_ip = $1} }' ip.org.sorted > output_file As an alternative to the already mentioned AWK book, here's a short "Awk in 20 Minutes" tutorial: http://ferd.ca/awk-in-20-minutes.html Bye, Andreas