#! /bin/sh

case $# in

1) test -d $1           || mkdir $1
   test -d ${1}/src     || mkdir ${1}/src
   test -d ${1}/libmcmc || mkdir ${1}/libmcmc
   cp -p ../../src/* ${1}/src
   cp -p ../../../libmcmc/src/* ${1}/libmcmc
   cp -p habit_main.h makefile $1 
   cp -p habit_main.out habit_main.err $1 
   cp -p fail*.dat rej*.dat stats*.dat theta*.dat pi*.dat $1
   cp -p theta_hat.dat V_hat.dat inv_J_hat.dat foc_hat.dat $1
   cp -p cache_l.dat cache_u.dat $1
   cp -p *.r $1
   ;;

*) echo Usage: $0 directory
   echo Example: $0 run00
   ;;

esac

case $? in
  0) exit 0 ;;
  esac
exit 1;
