#!/bin/sh

# adapt to your environment!
TPL_PATH="/home/web/eso/docs/observing/dfo/quality/TutorialPages"	#path to the file to be checked
TPL_FILE=`echo $1`					#name of file to be checked

cd $TMP_DIR/
rm -f ${TPL_FILE}
scp qc@w4:${TPL_PATH}/${TPL_FILE} $TMP_DIR/

dos2unix $TMP_DIR/${TPL_FILE} #just in case it has CTRL_C at the end

echo
echo

echo "===================================================="
echo "1. Check to have your name properly replaced:"
echo ""
grep -n "ChangeName" $TMP_DIR/${TPL_FILE} | sed "s/^.*/line &/" | sed "s/:/:	/"

echo ""
echo "Hit return if ok, or fix before you continue!"
read input

echo "===================================================="
echo "2. Check to have your instrument properly replaced:"
echo ""
grep -n "ChangeInst" $TMP_DIR/${TPL_FILE} | sed "s/^.*/line &/" | sed "s/:/:	/"

echo ""
echo "Hit return if ok, or fix before you continue!"
read input

echo "===================================================="
echo "3. Check to have the content (file names etc.) properly replaced:"
echo ""
grep -n "ChangeContent" $TMP_DIR/${TPL_FILE} | sed "s/^.*/line &/" | sed "s/:/:	/"

echo ""
echo "Hit return if ok, or fix before you continue!"
read input
