#!/usr/local/bin/perl

$file = shift(@ARGV);
open(FILE, "<$file") || die "Couldn't open $file\n";

while ($line = <FILE>) {
  $_ = $_ . $line;
}
close(FILE);

# Change any ftp commands

s!ftp.cs.utah.edu/pub/IntroSciProgMma!ftp.telospub.com/pub/Mathematica/IntroSciProgMma!g;


# Change the cover links

s!../../../ISPMmaCover.gif!/COVERS/zacharym.gif!g;
s!../ISPMmaCover.gif!/COVERS/zacharym.gif!g;


# Change the main page links

s!../IntroSciProgMma.html!../MATHEMATICA/IntroSciProgMma.html!g;
s!../IntroSciProg.html!../SCICOMPUTING/IntroSciProg.html!g;


# Output to the file

open(FILE, ">$file") || die "Couldn't open $file\n";

print FILE $_;
close(FILE);


