[nSLUG] Find and replace command

Trina Conrad trina.hanson79 at gmail.com
Thu Oct 2 22:27:42 ADT 2014


Adam,

Your Pearl Pie worked to a certain degree.  It did change the files in the
current directory, but I can not seem to find a way to make it do a blanket
find and replace to every sub-folder in the folder.  Perhaps I am missing
something.

Trina

On Thu, Oct 2, 2014 at 12:57 PM, Adam MacKinnon <adam at sogo.ca> wrote:

> Perl pie has always worked for me:
>
> $ perl -pi -e 's/<body background=.*?>/<body>/' ./*.html
>
> On Thu, Oct 2, 2014 at 12:25 PM, Sean Rickerd <srickerd at suse.com> wrote:
>
>>  Best way would be to write a script to look at each file and sed the
>> change.
>>
>>
>> ________________________________________
>> Sean Rickerd
>> Ingénieur Commercial/Sales Engineer
>> SUSE
>> 514.834.5778
>>
>>
>> >>> Trina Conrad <trina.hanson79 at gmail.com> 10/2/2014 11:23 AM >>>
>>
>> Hello all,
>>
>>
>>   I am working on my website and am doing some updates to it and I would
>> like to know is there a way to do a blanket find and replace for multiple
>> files so that I do not need to open each file and replace the one line that
>> is needing to be replaced?
>>
>>
>>   I am trying to replace is this line:
>>
>>
>>   <body background="Files/back.jpg" style="background-attachment: fixed;
>> background-repeat: repeat-y;">
>>
>>
>>   With this:
>>
>>
>>   <body>
>>
>>
>>   This needs to be able to sort through multiple folders, sub-folders
>> and even more sub-folders. :)
>>
>>
>>   Thanks,
>>
>> Trina
>>
>> _______________________________________________
>> nSLUG mailing list
>> nSLUG at nslug.ns.ca
>> http://nslug.ns.ca/mailman/listinfo/nslug
>>
>>
>
>
> --
> Thanks
>
> -Adam
>
> _______________________________________________
> nSLUG mailing list
> nSLUG at nslug.ns.ca
> http://nslug.ns.ca/mailman/listinfo/nslug
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/pipermail/nslug/attachments/20141002/60c06781/attachment.html>


More information about the nSLUG mailing list