From mint-bounce@lists.fishpool.fi Sat Sep 25 07:41:59 2010 Message-ID: <4C9DDF5B.4040607@freesbee.fr> Date: Sat, 25 Sep 2010 13:39:07 +0200 From: =?ISO-8859-1?Q?Vincent_Rivi=E8re?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: mint@lists.fishpool.fi Subject: Re: [MiNT] scripting References: <4C9DD0C8.3080907@freesbee.fr> <00131b59.01c73262a842@smtp.freeola.net> In-Reply-To: <00131b59.01c73262a842@smtp.freeola.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: vincent.riviere@freesbee.fr Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.sparemint.org id o8PBfwVE003538 Peter Slegg wrote: > find . -name $FILE -type f -exec perl -pi -e $REPL {} \; find is useful when you want to search for some files, then apply an action to them. Here, obviously it is useless because you want to execute an action to a single well known file, so just do it: perl -pi -e $REPL $FILE Also, find search in the directory given as argument, you passed "." (= the current directory) so it will never find a file located outside it. And also, the argument of -name should be a single name, it can't be an absolute path. So forget using find. > sed -e $REPL $FILE #> $FILE This can't work if you use the same file as input and output. The output will override the input, you mat get an empty file. The -i option of sed can change the contents of the input file, but it may not be supported in old sed versions. So the following may do what you want (untested): sed -i $REPL $FILE -- Vincent Rivière