Re: Howto replace .gif with .png in several html files?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 11 Jun 2003, M. Fioretti wrote:

> On Wed, Jun 11, 2003 20:23:33 at 08:23:33PM +0200, Patrick (shrike@xxxxxxxxxxxxxxxxx) wrote:
> > Hi,
> > 
> > After converting various gifs to png I still need to replace all
> > references to <pic>.gif in several html files to <pic>.png. Is there an
> > easy way to do this other than manually? Some sed/awk magic anyone?
> > 
> In Perl, for each HTML file, you would do on the command line:
> 
>    perl -pi.bak -e 's/\.gif\b/.png/g;' the_file.html
> 
> this will first create a backup copy named the_file.html.bak, then
> find all the strings _ending_ in .gif, and replace that with .png .
> 
> Try on disposable copies before going for it, however, and remember
> than the recipe above is case sensitive, will ignore .GIF, .Gif, etc..

and if you *want* it to be case-insensitive, just use

s/.../.../gi	(that is, add the "i")

rday




[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux