From owner-freebsd-questions@freebsd.org Sat Apr 8 01:46:09 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 9F74FD33461 for ; Sat, 8 Apr 2017 01:46:09 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mailrelay14.qsc.de (mailrelay14.qsc.de [212.99.163.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.antispameurope.com", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 265E1307 for ; Sat, 8 Apr 2017 01:46:08 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de ([213.148.129.14]) by mailrelay14.qsc.de; Sat, 08 Apr 2017 03:46:00 +0200 Received: from r56.edvax.de (port-92-195-127-117.dynamic.qsc.de [92.195.127.117]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id 539283C77D; Sat, 8 Apr 2017 03:45:59 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id v381jw6x005432; Sat, 8 Apr 2017 03:45:58 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sat, 8 Apr 2017 03:45:58 +0200 From: Polytropon To: Ernie Luzar Cc: freebsd-questions@freebsd.org Subject: Re: Is there a database built into the base system Message-Id: <20170408034558.2d9d1d99.freebsd@edvax.de> In-Reply-To: <58E83E19.8010709@gmail.com> 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> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-cloud-security-sender: freebsd@edvax.de X-cloud-security-recipient: freebsd-questions@freebsd.org X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mailrelay14.qsc.de with 7F5A1683426 X-cloud-security-connect: mx01.qsc.de[213.148.129.14], TLS=1, IP=213.148.129.14 X-cloud-security: scantime:.2220 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:46:09 -0000 On Fri, 07 Apr 2017 21:34:17 -0400, Ernie Luzar wrote: > 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. The manual is actually not a programming instruction, tutorial, or introduction course. Its main purpose is a reference, so you go to "man awk" when you have questions like "What is the order of the parameters in the gsub() substitution function?" ;-) > 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? Here is one: https://archive.org/download/pdfy-MgN0H1joIoDVoIC7/The_AWK_Programming_Language.pdf -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...