Add some standard places to PATH if they are not set by login script.
Rearrange the order of paths so system's are first, user's are last.
For Cygwin this helps with Cygwin's paths to be situated before
"C:/Windows" (Emacs is not started from a login shell on Windows!).
#!/bin/bash
set -x -e
emacsdir=~/.emacs.d
compatfile=$emacsdir/.emacs-ver
mylispdir_old=$emacsdir/my
mylispdir_new=$emacsdir/mylisp
if ! [[ -f $compatfile ]]; then
echo 'Cannot detect compatibility.'
exit 1
fi
read ver <$compatfile
if [[ $ver != 1 ]]; then
echo 'Script is designed only for upgrade: v1 => v2.'
exit 1
fi
rm $mylispdir_old/init.el || :
mv $mylispdir_old $mylispdir_new || :
rm $emacsdir/.emacs-my.elc || :
echo 2 >$compatfile