#!/bin/csh -f
#
# Script to copy matlab profile html and convert html files to use non-local images.
#

#-------------------------------------------------------------------------------
# Directory of profile output html files
set srcdir = "/projects/atl/FV_Matlab_Framework_JingPJH/trunk/Save/profile/Bottom_Gravity_Current_DO_042repeat"

#-------------------------------------------------------------------------------
# Directory of matlab specific styles etc on local computer
set matprofdir = "file:////share/apps/matlabr2014a/toolbox/matlab/codetools/"
# Directory of matlab specific styles etc on web site
set webprofdir = "http://mseas.mit.edu/download/phaley/Matlab/R2014a/"
#
# change special characters in above names (/ .) into sed compatible escaped versions
set matedname = `echo $matprofdir | sed -e s%/%\\\\/%g`
set webedname = `echo $webprofdir | sed -e s%/%\\\\/%g | sed -e s/\\./\\\\./g`

#===============================================================================
# Copy all matlab profile HTML files into local directory
/bin/cp -f ${srcdir}/*.html .

#-------------------------------------------------------------------------------
# Convert local file specifications to web versions
sed -i `ls *.html` -e s/$matedname/$webedname/g

