From owner-freebsd-current@FreeBSD.ORG Thu Sep 7 19:21:52 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 A852416A4DA for ; Thu, 7 Sep 2006 19:21:52 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from smtp7.server.rpi.edu (smtp7.server.rpi.edu [128.113.2.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 332FB43D45 for ; Thu, 7 Sep 2006 19:21:52 +0000 (GMT) (envelope-from gad@FreeBSD.org) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp7.server.rpi.edu (8.13.1/8.13.1) with ESMTP id k87JLotB018445; Thu, 7 Sep 2006 15:21:51 -0400 Mime-Version: 1.0 Message-Id: In-Reply-To: <44FFF466.2090700@infracaninophile.co.uk> 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> <44FFF466.2090700@infracaninophile.co.uk> Date: Thu, 7 Sep 2006 15:21:49 -0400 To: Matthew Seaman 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 19:21:52 -0000 At 11:28 AM +0100 9/7/06, Matthew Seaman wrote: >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'. > >Do you intend sfilter to subsume the functionality of nl(1)? >Seems like a natural match... One thing that I need to do, if I do this, is to write up a clear set of guidelines to describe what filters would fit the spirit and intent of this simple-filter command. In this case, I would say that `nl' would not fit my idea for `sfilter', because it: applies a configurable line numbering filter operation and when I look at the man page, it provides quite a few options to do that configuration. I do not expect `sfilter' to implement highly configurable options. While I admit that the -D option includes a lot of flexibility, all of that is already implemented and well-tested in the strftime() subroutine. The flexibility in -D is not being implemented by new code in `sfilter'. The `nl' command also: treats the text it reads in terms of logical pages. which is not how `sfilter' is going to operate. Apologies if this comes across like a lecture. Questions like this one are good questions, and in my own mind I am trying to figure out exactly what is and is not appropriate for a new command. So I am trying to come up with some strict set of rules for it, and make sure that what I "want" to do does not conflict with those rules. And that is a challenge, as one goals is that the final executable should not be much larger than the original `cat' command. 50% larger would be fine. 100% larger would be a maybe. 200% larger, and IMO the command is going haywire. Despite my earlier comments about an "all-singing, all dancing" filter command, I really don't want this to turn into the "kitcken-sink filter command". I want it to provide a few simple filters, all of which can be implemented within a single read/write loop in a single program. I may find out that I need to scale my ideas back to a `dfilter' command with just the date/time options, and then dream up some other command for other kinds of simple filters. -- Garance Alistair Drosehn = drosehn@rpi.edu Senior Systems Programmer or gad@FreeBSD.org Rensselaer Polytechnic Institute; Troy, NY; USA