#! /bin/bash

# Checks whether the last component of the current directory pathname
# is ${exp}.

exp="$1"; shift # Expected tail of directory.

# Check if the right directory:
thisdir="`pwd`"
taildir="${thisdir##*/}"
echo "directory = ${taildir}"
if [[ "${taildir}" != "${exp}" ]]; then
  echo "** wrong directory, should be */${exp}" 1>&2
  exit 1
fi
