Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!rutgers!bpa!cbmvax!uunet!mcvax!hp4nl!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.unix.questions Subject: Re: sed question Keywords: sed, regexp, Pnews, Rnmail Message-ID: <938@philmds.UUCP> Date: 28 Jan 89 09:31:50 GMT References: <17810@vax5.CIT.CORNELL.EDU> Reply-To: leo@philmds.UUCP (Leo de Wit) Distribution: comp Organization: Philips I&E DTS Eindhoven Lines: 13 In article <17810@vax5.CIT.CORNELL.EDU> jhc@Vax5.CIT.Cornell.EDU (James H. Cloos, Jr.) writes: [] |I'm having difficulty getting the sed line correct. Specifically, I want |sed to find the line that starts Reply-To: and then replace any instances of |() with ($REALNAME) where $REALNAME is the value of the environmental |variable REALNAME, and where the parenthesis are in the file. [] sed '/^Reply-To:/s/()/('$REALNAME')/g' your_file Since the $REALNAME is outside quotes, it is expanded by the shell. Leo.