From owner-freebsd-questions Thu Mar 18 17: 6:21 1999 Delivered-To: freebsd-questions@freebsd.org Received: from alpha.comkey.com.au (alpha.comkey.com.au [203.9.152.215]) by hub.freebsd.org (Postfix) with SMTP id 99CE014E7B for ; Thu, 18 Mar 1999 17:04:58 -0800 (PST) (envelope-from gjb@comkey.com.au) Received: (qmail 15839 invoked by uid 1001); 19 Mar 1999 00:29:19 -0000 Message-ID: <19990319002919.15838.qmail@alpha.comkey.com.au> X-Posted-By: GBA-Post 1.04 06-Feb-1999 X-PGP-Fingerprint: 5A91 6942 8CEA 9DAB B95B C249 1CE1 493B 2B5A CE30 Date: Fri, 19 Mar 1999 10:29:19 +1000 From: Greg Black To: Mark Ovens Cc: freebsd-questions@FreeBSD.ORG Subject: Re: sed and newlines References: <199903172339.SAA06674@cc942873-a.ewndsr1.nj.home.com> <19990318122811.11031.qmail@alpha.comkey.com.au> <36F0FFB4.9EFDDF15@uk.radan.com> In-reply-to: <36F0FFB4.9EFDDF15@uk.radan.com> of Thu, 18 Mar 1999 13:29:24 GMT Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > the man page, which is one of the great masterpieces of obscurity[1]. > > [....] > > > [1] How many people understood what they could do with "hold" > > spaces and "pattern" spaces and how to shuffle stuff between > > them on their first reading of the sed man page? And how > > many then found they didn't understand it after all when > > they tried to make it work? > > Which probably explains why O'Reilly make a profit from a 400+ page > book covering only sed and awk. I've never looked at that book, partly because I knew everything I wanted to know about sed and awk before it appeared and partly because I find it easy to teach the use of both those programs without additional material. On the other hand, the lex and yacc pair *do* need extra help for the teacher. The first edition of the ORA book on lex and yacc was close to useless; the second edition, with lots of new material and much of the old stuff re-written, is a vast step forward (although it still falls well short of what I'd like it to be for teaching purposes). I mention lex and yacc because they are the natural next step when you can't do what you want with sed and awk. Sometimes, of course, the best next step is to look at the problem differently and switch to a more modern tool such as Python. (Python can't even come close to replacing lex and yacc for the serious work, of course; but it can manage the simple kind of task we've been looking at here with ease.) -- Greg Black To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message