Subject: Re: learning and using sed (was about truncate(1))
To: Greg A. Woods <woods@weird.com>
From: Andrew Brown <atatat@atatdot.net>
List: tech-userlevel
Date: 07/22/2000 01:46:17
>> i've got that. it has a chapter or two on sed and then spends the
>> rest of its time on awk. it doesn't really tell me much at all. now
>> if there was a book that spent as much time on sed, or something like
>> the awk book (by aho, weinberger, and kernighan), that would be good.
>> but there ain't.
>
>Well the first thing you need to learn in order to use sed is all there
>is to know about ed.
no...the first thing you need to know is that sed is not all just
sed 's/foo/bar/' file...
tha's what most people use it for.
>I didn't think I had the O'Reilly "sed & awk" book, but the sed section
>is reprinted in chapter 6 of the "Handbook of Programming Langugages
>Volume III: Little Languages and Tools", edited by Peter Salus
>(published by Macmillan).
the sed section is nothing new, and very little help.
>That chapter is quite a good tutorial, and does cover all the basics
>(except for the the real nitty gritty on regular expressions), but it
>doesn't get into some of the really fancy stuff you can do with the hold
>space. I don't see any mention of the "branch to label" (goto!) feature
>in there either.
regular expressions i've got down. i like to annoy my friends by
using the all-new, ultra-powerful, conpletely non-portable zero-width
negative look-behind assertions that perl has. the branch-to-label
stuff i think i tried once. i might even have gotten it to work. but
what i can't do is the stuff i see in po2tbl.sed (from texinfo).
>Lee McMahon's original 1978 paper on sed from the "Unix Programmer's
>Manual Volume 2, 7th Edition", and especially the version revised by
>L. Cherry and printed in the "Unix Research System Papers, Tenth Edition
>Volume II", is a bit better than the manual page because it does include
>some additional discussion and a few examples. You can find at least
>the first version online at http://plan9.bell-labs.com/7thEdMan/
hmm...
--
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org * "ah! i see you have the internet
twofsonet@graffiti.com (Andrew Brown) that goes *ping*!"
andrew@crossbar.com * "information is power -- share the wealth."