Greg Carrara wrote:
> 
> Hello,

Hello,

> I'm trying to search for a word and replace it multiple files at a windows
> command prompt with the following:
> 
> perl -pi -e 's/wordToFind/replaceWithThisWord/gi'*.fileExtension
> 
> This errors out.  I've tried to replace the delimiters / with - to no effect.
> Does someone know how to alter this to make it work under Windows?

You have three problems there.  1) In Windows (AFAIK) the -i switch requires
a string or it won't work properly;  2) The Windows shell doesn't like single
quotes on the command line, you have to use double quotes, and;  3) The Windows
shell doesn't expand wildcard characters, you have to do that in perl.  (This
depends on your version of Windows and which shell you are using.)

perl -pi.bak -e"[EMAIL PROTECTED] shift} s/wordToFind/replaceWithThisWord/gi" 
*.fileExtension

(untested!)


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to