From owner-freebsd-questions@freebsd.org Sat Apr 8 01:33:44 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 387A1D338A9 for ; Sat, 8 Apr 2017 01:33:44 +0000 (UTC) (envelope-from luzar722@gmail.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (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 0762CAA5 for ; Sat, 8 Apr 2017 01:33:43 +0000 (UTC) (envelope-from luzar722@gmail.com) Received: by mail-io0-x241.google.com with SMTP id b140so4101081iof.0 for ; Fri, 07 Apr 2017 18:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-transfer-encoding; bh=WSNPnw6/2kjJ6cSODEs7Z/yugz8Ylb6fw8sI1Dt0pH4=; b=UlgsadM9+wSVdcrSu+lURFxOxw0KK0QbmifD+WpSkYcUxHTi8R+EOvEaWxhkEDCy3i 3N+EXgZAIYbFT9R54TjBShdUsw5LCcTx0FqlqtZpfbbApANfRWf9sH1LthZSMn3bspxN K5FmrWbWYlXZrnYG8ELXqJDE5HQQUSeIDflX+ZBAHJMPfOznzX95PzkezGun2t6Iy4O3 61n/GAcr0hWX3p/WJQG8cRUUuZz6VNfTvN8hFR9pudvMU495R2pbZJx40EAI+e58ls79 +O+j5ZeT8RABWmzoGzjHwiib0u5nQ5c9/eyLvQxNF7zfPP9GbgBHLLLqNZjnMgcmLmjz QyZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-transfer-encoding; bh=WSNPnw6/2kjJ6cSODEs7Z/yugz8Ylb6fw8sI1Dt0pH4=; b=dxjNY9FA6Lv3MmHEwP2VRM0MiQKGiKQ1glMjIsQ3jMw1uuskc7sGYtEdE235eKMJO4 KJn1a35w9MrTi2kJZcbExhiWVpzusql7QiJFgxv6uIs/uH59trm52aTDdmauCV4cJUh5 v0B4jUbH3LcIOv0Wst+DR/SWNZRGm/4zcjJr7iAxkQOKQaKYAv2h9Cjj/ufzKz1sl+tp HPPFviHK7aTb2gbcWxraRNjW+xjA/CNa9RBt16u5Gua0X1fXFlL22+F9bffCcnVcAKdi 1bYOgmVs56/cAKRjIHjd7D5WaSV3K9/L5LbFRmlk4p3lltjvTXgFimsh2j5moCjZgU/Y TYJw== X-Gm-Message-State: AN3rC/6Qu8IPM2IQ4k1qkAiCPnvHQYgvvNbZFhNvpNNRqDXgQtOYD9mgx6RULMkQyK2PTw== X-Received: by 10.107.144.193 with SMTP id s184mr4649200iod.88.1491615223245; Fri, 07 Apr 2017 18:33:43 -0700 (PDT) Received: from [10.0.10.3] (cpe-74-141-88-57.neo.res.rr.com. [74.141.88.57]) by smtp.googlemail.com with ESMTPSA id r30sm3217829ioi.56.2017.04.07.18.33.42 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Apr 2017 18:33:42 -0700 (PDT) Message-ID: <58E83E19.8010709@gmail.com> Date: Fri, 07 Apr 2017 21:34:17 -0400 From: Ernie Luzar User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Karl Young CC: Tomasz Rola , freebsd-questions@freebsd.org Subject: Re: Is there a database built into the base system 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> In-Reply-To: <20170407210629.GR2787@mailboy.kipshouse.net> Content-Type: text/plain; charset=ISO-8859-1; 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 01:33:44 -0000 Karl Young wrote: > Tomasz Rola(rtomek@ceti.pl)@2017.04.07 02:11:01 +0200: >> On Thu, Apr 06, 2017 at 05:14:40PM -0400, Ernie Luzar wrote: >> [...] >>> inbound source ip address hits my front door. Have 3 flat text files >>> containing about 2000 ip address having a record size of 30 bytes. >>> I am afraid I may be approaching the max file size that csh can handle. >>> Thinking of simple db where the 3 files are indexed and can be >>> read/written with out sequentially process all the records. At the >>> proof of concept stage. >> If I had problem processing 2000 records (or 60 kilobytes) on a >> machine less than 20 years old, I would definitely rethink my >> strategy/algorithm. >> >>> I have programmed in pear script before where I can open a file and >>> process a record sequentially where only the next record is >>> buffered. csh does not have that kind of file handling that I know >>> of.ave never used it because >>> >>> You have any suggestions? >> I understand you need to run this under base system (because you want >> no ports). I guess you need to do "man awk" - it seems to be the only >> language capable enough in such environment. Albeit if you are >> masochist, you can stay with csh or learn sh (and sort, cut and few >> other things). >> > > Ah, I thought there was perl and python in base system. If not, then I > second the awk recommendation. Awk is powerful enough, and should be > fast enough for what OP has described. > > But I wouldn't suggest to learn awk from man page. "The Awk Programming > Language", written by the inventors of Awk, is a lovely book and even has > a whole chapter on databases. > > And, it's available for free. > > https://archive.org/stream/pdfy-MgN0H1joIoDVoIC7/The_AWK_Programming_Language_djvu.txt > As the op I have been reading all the replies. I know that awk exists, but never used it because the man page is so hard to understand. I like this manual but this online version is hard to navigate. Does any one know if there is a pdf version available for download?