home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!agate!rsoft!mindlink!a3358
- From: Ian_Staines@mindlink.bc.ca (Ian Staines)
- Subject: multiple sub's with 'sed'
- Organization: MIND LINK! - British Columbia, Canada
- Date: Fri, 22 Jan 1993 04:39:26 GMT
- Message-ID: <19891@mindlink.bc.ca>
- Sender: news@deep.rsoft.bc.ca (Usenet)
- Lines: 18
-
- sed novice seeks help (sed man page is greek to me)
-
- How can I get 'sed' to do multiple substitutions? I would like to replace
- certain words in a text file with bold type. I have tried the following:
-
- for WORD in ${LIST}
- do
- BOLD="${bold}${WORD}${unbold}"
- sed "/s/${WORD}/${BOLD}/gw ${FILE}" ${FILE}
- done
-
- The shell appears to keep ${FILE} intact within the script, and does not
- updated it with each loop. I only get the last substitution, not the entire
- list.
-
- Is there a way to loop within sed?
-
-
-