#!/bin/bash rm -rf index.DUFF/ if [ -d index/building ] ; then echo " Moving 'building' out of 'index'" mv index/building . echo " Renaming 'index' to 'index.DUFF'" mv index index.DUFF echo " Renaming 'building' to 'index'" mv building index else echo " Failed to find 'building' inside 'index'" >&2 echo " Directory structure not in the form expected for fixing" >&2 echo " Exiting" >&2 fi