Path: utzoo!attcan!uunet!virtech!cpcahil From: cpcahil@virtech.uucp (Conor P. Cahill) Newsgroups: comp.unix.questions Subject: Re: shell script question Message-ID: <1990Mar4.133827.4967@virtech.uucp> Date: 4 Mar 90 13:38:27 GMT References: <652@sagpd1.UUCP> Reply-To: cpcahil@virtech.UUCP (Conor P. Cahill) Organization: Virtual Technologies Inc., Sterling VA Lines: 16 In article <652@sagpd1.UUCP> jharkins@sagpd1.UUCP (Jim Harkins) writes: > >foreach i (list of files) > sed 's/foo/$i/' < $i > tmp ^^^^^^^^^^^ > mv tmp $i >end The single quotes stop expansion of shell variables, hence the change to $i. You should use something like sed "s/foo/$i/" < $i > tmp -- Conor P. Cahill (703)430-9247 Virtual Technologies, Inc., uunet!virtech!cpcahil 46030 Manekin Plaza, Suite 160 Sterling, VA 22170