From owner-freebsd-current@FreeBSD.ORG Thu Sep 7 02:00:41 2006 Return-Path: X-Original-To: freebsd-current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7591E16A4F5 for ; Thu, 7 Sep 2006 02:00:41 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from smtp6.server.rpi.edu (smtp6.server.rpi.edu [128.113.2.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 77B0543D62 for ; Thu, 7 Sep 2006 02:00:33 +0000 (GMT) (envelope-from gad@FreeBSD.org) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp6.server.rpi.edu (8.13.1/8.13.1) with ESMTP id k8720VZW027441; Wed, 6 Sep 2006 22:00:32 -0400 Mime-Version: 1.0 Message-Id: In-Reply-To: <20060906215431.259374bf.rnsanchez@gmail.com> References: <200608281545.k7SFjn6l063922@lurza.secnetix.de> <200609020956.54008.Lucas.James@ldjcs.com.au> <20060902031247.GE749@turion.vk2pj.dyndns.org> <20060904192006.GA3292@turion.vk2pj.dyndns.org> <44FD994C.70104@errno.com> <44FDEE7C.9060104@FreeBSD.org> <44FDF245.9000302@elischer.org> <44FDF36A.3010608@FreeBSD.org> <20060906215431.259374bf.rnsanchez@gmail.com> Date: Wed, 6 Sep 2006 22:00:30 -0400 To: Ricardo Nabinger Sanchez From: Garance A Drosehn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) Cc: freebsd-current@FreeBSD.org Subject: Re: Attempt #3, adding a new command 'sfilter' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2006 02:00:41 -0000 At 9:54 PM -0300 9/6/06, Ricardo Nabinger Sanchez wrote: > >On Wed, 6 Sep 2006, Garance A Drosehn wrote: > >> Actually, I have another useful option in mind that could be added >> with very little effort. So let me say that I do intend to install >> this as a new /usr/bin/sfilter command, assuming that does not >> generate too many objections. I expect this will work out better >> than adding new options to `date' or to `cat'. > >First of all, the purpose of my message is to (politely) ask a >question, not object the proposals so far nor suggest anything -- >so don't be offended. Heh. No, I'm not offended by questions! >The way I understand all these proposals, sfilter will eventually >be equivalent to sed/awk in terms of features. No. My intent is that it will never have regexps, etc. It will not allow the user to create arbitrary filters. It will only support a certain set of specific and "simple" filtering options. By simple, I mean things that it can determine by looking at no more than two consecutive characters of the file at a time (which is all that 'cat' currently looks at: "this" character and "the previous" character). The idea is also to keep the object file very small, ideally very close to the size of `cat'. I might bump that up to four consecutive characters, if that was needed to add some level of unicode awareness in it... >Now the question: would it be appropriate to extend sed/awk in order >to implement these cool features? Or this would break POLA, for >placing variable timestamps whereas one would expect them to be >the same for every line, just like the current behavior of sed? It would make some sense to have these done in `awk', and in fact everything but the timestamp-related options can already be done in awk. But we want FreeBSD to stick with "the one true awk" (that is it's actual name... :-), so we wouldn't add features there. Many people expect `awk' to have the specific features of the original `awk'. No more features, no less. This is important when you write a script on one computer, and then you want to run the same script on many other computers without having to worry about what version of awk is installed. While I'm sure I could dream up some extension to `sed' to do the kinds of things I'm thinking of, I personally don't think these really fit into `sed'. And even if I did, the same issues would apply to `sed' as come up for `awk'. If you go and buy the most recent, up-to-date book on "Sed & Awk" from O'Reilly, you'll find that it was last updated in 1997. And *most* things in those two commands haven't changed much since the first edition, in 1990. -- Garance Alistair Drosehn = drosehn@rpi.edu Senior Systems Programmer or gad@FreeBSD.org Rensselaer Polytechnic Institute; Troy, NY; USA