[CS-FSLUG] I need a quick way to edit quite a few html documents

Tim Young Tim.Young at LightSys.org
Thu Jun 9 19:41:46 CDT 2011


Sed is one of those "amazing" unix tools.  I have been using it for 
years and years (15+) and still do not think I am effective with it.  
:)  There are tons of things that I once knew how to do with it that 
I no longer can...  But I can still do a lot more with it than a lot 
of people can.  :)  It is the equivalent of a blow-torch or a 
chainsaw.  Some people do a lot more with it than others...

(If I remember the story correctly, Dave, to whom I am talking, once 
kept an engine from falling out of a truck by using a chain-saw 
creatively.  Putting "sed" into his hands may be interesting...  
Looking forward to seeing what he does with it.)

     - Tim

On 6/9/2011 7:25 PM, davidm at hisfeet.net wrote:
> "ls g*.htm?" does display a file list, but only of those files htm 
> files that end with an "l", so I guess that "?" means any letter 
> that is there, but insists that there be some letter there. 
> escaping the period didn't help, but that may be because I made too 
> many changes before I tried it.
>
> Finaly: when I tried:"for file in i*.htm; do sed -i 
> 's/index.html/index2.htm/g' $file; done" It worked for all the 
> files that started with "i" and ended  with ".htm"   Then: "for 
> file in *.htm; do sed -i 's/index.html/index2.htm/g' $file; done" 
> Got the rest of them. except for the ones that end with "l", or 
> something completely different.
>
> Thanks this looks like an excellent tool if I can just learn how to 
> use it effectively.
>
> Dave
>
>




More information about the Christiansource mailing list