From owner-freebsd-questions@freebsd.org Fri Apr 7 21:34:12 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 496E1D33D0C for ; Fri, 7 Apr 2017 21:34:12 +0000 (UTC) (envelope-from karly@kipshouse.net) Received: from mgmt.ironboy.kipshouse.net (ironboy.kipshouse.net [IPv6:2001:470:835a:4242::42]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "mx.kipshouse.net", Issuer "Starfield Secure Certificate Authority - G2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D35DBEB2 for ; Fri, 7 Apr 2017 21:34:11 +0000 (UTC) (envelope-from karly@kipshouse.net) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=kipshouse.org; i=@kipshouse.org; q=dns/txt; s=kh-ss; t=1491600852; x=1523136852; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; z=Date:=20Fri,=207=20Apr=202017=2014:06:29=20-0700|From: =20Karl=20Young=20|To:=20Tomasz=20Ro la=20|Cc:=20freebsd-questions@freebsd.org ,=20Ernie=20Luzar=20|Subject:=20Re: =20Is=20there=20a=20database=20built=20into=20the=20base =20system|Message-ID:=20<20170407210629.GR2787@mailboy.ki pshouse.net>|References:=20<58E696BD.6050503@gmail.com> =0D=0A=20<69607026-F68C-4D9D-A826-3EFE9ECE12AB@mac.com> =0D=0A=20<58E69E59.6020108@gmail.com>=0D=0A=20<2017040621 0516.c63644064eb99f7b60dbd8f4@sohara.org>=0D=0A=20<58E6AF C0.2080404@gmail.com>=0D=0A=20<20170407001101.GA5885@tau1 .ceti.pl>|MIME-Version:=201.0|In-Reply-To:=20<20170407001 101.GA5885@tau1.ceti.pl>; bh=HLLHHE9UcJ0bQ4Z3xIVJZvm9fCj1Iphk8Gkafup6TtY=; b=dvouEsXiazezy4QVFZfjLFRCvI+q6klibe2Fk3yEejU/Ld4Cx3FAprte JtwOumchOgjlbp2rFOtuBVAcreupuzHoPhnkevUl2kMuDI1ghOAT7AmCa K09N+LtcdFOv+k+jyw10X2iOQ4lA7OBB6ObAooBKBq56MuuyPCV1JDBhM HD0uSG04Lcyy/sx5G8icROgHp0QoJPR4QW7WlyPLBWmMQQOmrDoFUyouC 01a9UWkZI+rjQADaVvqLxkXlJQTpGJoS7kg35ckxO8oRWEyJcghQHQUjv 1l8e21na8YZFTfHh8aliWXQ+rIYYHT/FoDb5pb1EiNlDyo5UECIb7FUEP A==; Authentication-Results: d2.ironport.kipshouse.net; dkim=none (message not signed) header.i=none; spf=None smtp.pra=karly@kipshouse.org; spf=None smtp.mailfrom=karly@kipshouse.net; spf=None smtp.helo=postmaster@mailboy.kipshouse.net Received-SPF: None (d2.ironport.kipshouse.net: no sender authenticity information available from domain of karly@kipshouse.org) identity=pra; client-ip=2001:470:835a:1010::26; receiver=d2.ironport.kipshouse.net; envelope-from="karly@kipshouse.net"; x-sender="karly@kipshouse.org"; x-conformance=sidf_compatible Received-SPF: None (d2.ironport.kipshouse.net: no sender authenticity information available from domain of karly@kipshouse.net) identity=mailfrom; client-ip=2001:470:835a:1010::26; receiver=d2.ironport.kipshouse.net; envelope-from="karly@kipshouse.net"; x-sender="karly@kipshouse.net"; x-conformance=sidf_compatible Received-SPF: None (d2.ironport.kipshouse.net: no sender authenticity information available from domain of postmaster@mailboy.kipshouse.net) identity=helo; client-ip=2001:470:835a:1010::26; receiver=d2.ironport.kipshouse.net; envelope-from="karly@kipshouse.net"; x-sender="postmaster@mailboy.kipshouse.net"; x-conformance=sidf_compatible X-SBRS: None X-MID: 242870 X-RemoteIP: 2001:470:835a:1010::26 X-RemoteHost: 2001:470:835a:1010::26, mailboypriv.kipshouse.net X-IronPort-AV: E=McAfee;i="5800,7501,8491"; a="242870" Received: from mailboypriv.kipshouse.net (HELO mailboy.kipshouse.net) ([IPv6:2001:470:835a:1010::26]) by d2.ironport.kipshouse.net with ESMTP; 07 Apr 2017 14:34:11 -0700 Received: by mailboy.kipshouse.net (Postfix, from userid 500) id CCA3443F00; Fri, 7 Apr 2017 14:06:29 -0700 (PDT) Date: Fri, 7 Apr 2017 14:06:29 -0700 From: Karl Young To: Tomasz Rola Cc: freebsd-questions@freebsd.org, Ernie Luzar Subject: Re: Is there a database built into the base system Message-ID: <20170407210629.GR2787@mailboy.kipshouse.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170407001101.GA5885@tau1.ceti.pl> X-Arbitrary-Number-Of-The-Day: 42 X-URL: http://www.kipshouse.org/karly X-Work-URL: http://www.cisco.com/ X-Disclaimer: My opinions do not necessarily represent those of my employer. User-Agent: Mutt/1.5.20 (2009-12-10) 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: Fri, 07 Apr 2017 21:34:12 -0000 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. > > > > 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 Enjoy -karl > -- > Regards, > Tomasz Rola > > -- > ** A C programmer asked whether computer had Buddha's nature. ** > ** As the answer, master did "rm -rif" on the programmer's home ** > ** directory. And then the C programmer became enlightened... ** > ** ** > ** Tomasz Rola mailto:tomasz_rola@bigfoot.com ** > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"