SHELLNAME=$(ps $$|awk 'NR==2{print $5}')
regex='bash$'
if [[ ! $SHELLNAME =~ $regex ]]; then
    echo "ERROR: script is running under wrong shell: $SHELLNAME"
    echo "Please use bash"
    exit 1
fi