IMG tag and relative/evaluated location

IMG tag and relative/evaluated location

We have a structure already defined that is now being modified, containing more than 400 pages that include IMG tags. The entire “mess” is being moved to another server/structure such that the relative references in the IMG tags will no longer be valid.

Is there any way other than (a) editing 400+ individual HTML docs, or (b) writing a script to perform the changes, that allows for the “../../” relative references in the IMG tags to be evaluated with some type of variable a la UNIX scripts? Or is this beyond the scope of basic HTML?

For example, IMG SRC=”../../abc/mygif.gif” &#151 is there any way to have “../../abc/” replaced with a variable entity/expression that can be evaluated in its place, as in:IMG SRC=some_token “mygif.gif”?

You will need to either run a script or use a local editor, such asHomeSite, to edit the path names. A simple search and replace script wouldbe something like this:

#! /bin/csh# Call this file Replace FILE with * for all files, or a partial file name# Replace OLDPATH with the old path name and NEWPATH with# the new path name.# Don't forget to backslash any slashes, so if the OLDPATH is# ../../ you will need to type ../../foreach f (FILE)foreach g ($f/*.html)	cat $g | sed -e 's/OLDPATH/NEWPATH/g' > tmp	mv -f tmp $gendend

Place it in the root directory, and make it executable by typing:

%  chmod +x

and run it by typing:


Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved