[ Date Index ][
Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]
[LUG] More scripting silliness...
-----BEGIN PGP SIGNED MESSAGE-----
I'm trying to build a mirroring system for my ecommerce store at
http://www.smssat.biz in order to improve performance. Thanks to the help of
this group, I've got a script that renames all of the files in the "static"
version to remove the variable string from the filenames.
However, I was hoping that I'd just be able to use relative links to get over
the problem of removing the "link" name from the URL, ie. the relative link
effectively changes because the files have been moved to the HTML directory:
http://www.smssat.biz/sms.ic/index.html -> http://www.smssat.biz/index.html
However, what I was forgetting is that Interchange uses strokes ('slashes' if
you prefer, but that sounds a bit violent to me) in the search string. Why,
I really don't know, it seems a bit stupid to me and it might be the reason
why Google is refusing to index it :-( But the main problem is that it mucks
up the relative links.
Eg. you run a search and get sent to this location:
Where there is a relative link to "./index.html", but of course that now
I hope this makes sense! So anyway, the upshot of this is that I am going to
need a script that rewrites the links in every page to take out the "sms.ic"
bit. Thus the dynamic version can spit out working links (with "sms.ic") and
wget can spider it properly (without spidering it's own mirror), but the
static version links to itself. And everybody is happy and world peace is
finally acheived ;-)
Can anybody suggest a script to do it?
Current script (well, the 'core' bit anyway), for reference:
find . -type f -name '*' |while read -r AFILE
NEWNAME=`expr "$AFILE" : "\(.*\)?"`
if [ -a $NEWNAME ]
echo Duplicate file name $NEWNAME would be created
mv $AFILE $NEWNAME
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
-----END PGP SIGNATURE-----
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.