#!/bin/bash


#cree le listing du repertoire REPtoLISTE ($1) 
#exemple REPtoList=/dmnfs09/cont003/p86cadul/IGCM_OUT

REPtoList=$1


EXE_DIR=$(dirname ${0})
SCRIPT_NAME=$(basename ${0} )
export IGCM_DEM=${IGCM_DEM:-${SCRATCHDIR}/IGCM_DEM}
export IGCM_TMP=${IGCM_TMP:-${IGCM_DEM}/tmp}


find $REPtoList -printf "%y %s %p \n" >> ${IGCM_DEM}/Listing.txt

cd $EXE_DIR
#lors de la creation de la liste on retire les repertoires SPIN qui seront traites ulterieurement par le ccrt 
sed '/SPIN/d' ${IGCM_DEM}/Listing.txt > ${IGCM_TMP}/Listing_tmp.txt; mv ${IGCM_TMP}/Listing_tmp.txt ${IGCM_DEM}/Listing.txt
#possibilite de retirer d'autres types de fichiers ex: .jnl* 
