#!/bin/bash

echo " "
! ls  | grep exiflist > /dev/null && 
  { echo "Not in correct directory."; 
    echo "cd to directory into which EXIFutils was installed, then try again"; 
    exit 1;
  }

echo "Saving backup of .profile in .profile.exifutils"
cp ~/.profile ~/.profile.exifutils

echo "Saving backup of .tcshrc in .tcshrc.exifutils"
cp ~/.tcshrc ~/.tcshrc.exifutils

echo "Adding EXIFutils directory `pwd` to execution PATH."
grep -v "EXIFutils Installation" ~/.profile.exifutils > ~/.profile
echo "PATH=\$PATH:`pwd`; export PATH  # EXIFutils Installation" >> ~/.profile
echo "~/.profile updated."

grep -v "EXIFutils Installation" ~/.tcshrc.exifutils > ~/.tcshrc
echo "setenv PATH \${PATH}:`pwd`  # EXIFutils Installation" >> ~/.tcshrc
echo "~/.tcshrc updated."
echo "EXIFutils installation complete."
echo " "
