shell script question

Jim Harkins jharkins at sagpd1.UUCP
Sat Mar 3 06:11:28 AEST 1990


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 at 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



More information about the Comp.unix.questions mailing list