Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!uwm.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: shell script question Message-ID: <12283@smoke.BRL.MIL> Date: 4 Mar 90 00:42:07 GMT References: <652@sagpd1.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 7 In article <652@sagpd1.UUCP> jharkins@sagpd1.UUCP (Jim Harkins) writes: > sed 's/foo/$i/' < $i > tmp >But what this does is replace 'foo' with '$i', not the filename. Not surprising when you consider that the shell does not perform variable substitution within ''-quoted strings. Use "" instead, or arrange for the $i to be outside the quotes.