Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucsd!ucsdhub!hp-sdd!ncr-sd!sagpd1!jharkins From: jharkins@sagpd1.UUCP (Jim Harkins) Newsgroups: comp.unix.questions Subject: shell script question Message-ID: <652@sagpd1.UUCP> Date: 2 Mar 90 19:11:28 GMT Organization: Scientific Atlanta-GPD, San Diego Lines: 16 I have a list of files in which I want to change the word 'foo' to the filename. What I tried to do was foreach i (list of files) sed 's/foo/$i/' < $i > tmp mv tmp $i end But what this does is replace 'foo' with '$i', not the filename. Can anybody help? I'm running 4.3 BSD UN*X. Thanks. -- jim jharkins@sagpd1 "I've found by and large that when the flu gets you, the best thing to do (other than go to bed, which is boring) is to go conquer something." -Jerry Pournelle