Simple VI/Script Question
I believe this is a simple question that just has me stumped at the moment.
I am creating a new site and for some dumb reason linked all of the images to the Document root rather than the images directory. Therefore, my image tag looks like <img src="image.gif"> in all of my files. I would like to either use awk, vi, or whatever really that would get the job done to insert "images" before the .gif filename thus it would look like: <img src="images/image.gif) I know in VI I can use :g/image.gif/s/image.gif/newName/g in order to do a replace however since I have many images with multiple names this would not work. I was hoping someone here might have a way to insert "images" before any .gif file. Thanks for the help in advance! |
maybe this will help you:
:%s;<img src=";<img src="images/ simply type :help substitute in vim |
Thanks ALOT! Once I saw your solution it seemed so simple that I can't believe I forgot about the wildcard that would do what I needed. With what you gave me it put the *images/ literaly therefore I took that out and it work perfectly.
:%s;<img src=*;<img src=images/ The more I learn the more I love Linux..... Thanks Again!!! : > /mnt/windows |
All times are GMT -5. The time now is 09:38 PM. |