[nSLUG] Find and replace command

Adam MacKinnon adam at sogo.ca
Thu Oct 2 12:57:51 ADT 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/pipermail/nslug/attachments/20141002/41eca468/attachment.html>


More information about the nSLUG mailing list