[geeks] search and replace

David Selders david.selders at malleable.org
Fri Sep 5 12:31:53 CDT 2003


On Fri, Sep 05, 2003 at 01:23:44PM -0400, Kevin wrote:
> I've got an folder full of html docs that reference a
> file in one location and i want to move that file to
> another location.  What i need is a way of replacing
> the string "pic.gif" with the string "images/pic.gif"
> in all of these documents.
> 
> I'm guessing there is someway to accomplish this with a
> bash or csh script but i lack a mastery of either.  Any
> help would be much appreciated.
> 
> Note: i'm sure i could load up all the files into a
> word processor and search and replace but i feel
> certain that there's a more elegant way :)
> 
> Thanks,
> /KRM

Take a look at sed
http://www.gnu.org/manual/sed/

-- 
David Selders
david at malleable.org
Martinez, Ca



More information about the geeks mailing list