Newsgroups: comp.unix.questions Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!jpradley!jpr From: jpr@jpradley.jpr.com (Jean-Pierre Radley) Subject: Re: changing a file Organization: Unix in NYC Date: Fri, 31 May 1991 00:56:15 GMT Message-ID: <1991May31.005615.26362@jpradley.jpr.com> References: <91141.140213KJB6@psuvm.psu.edu> In article <91141.140213KJB6@psuvm.psu.edu> KJB6@psuvm.psu.edu writes: > >As a script, I would like to search a file and replace a string with >another string. I know this can be done, but I have not figure out how to >do it yet. Anyone have any suggestions. I think if I use awk or nawk somewhere >along the line, I can get it done. The answer I'd provide is not my own, it's straight out of Kernighan & Pike. Look in their book's index for 'replace'. (They use sed for this, since awk would work but would be overkill.) Jean-Pierre Radley Unix in NYC jpr@jpr.com jpradley!jpr CIS: 72160,1341