--- mitgcm.org/front_content/parse_emails 2010/02/17 22:25:46 1.22 +++ mitgcm.org/front_content/parse_emails 2010/10/31 02:25:05 1.24 @@ -1,6 +1,6 @@ #! /usr/bin/env bash -# $Header: /home/ubuntu/mnt/e9_copy/mitgcm.org/front_content/parse_emails,v 1.22 2010/02/17 22:25:46 jmc Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/mitgcm.org/front_content/parse_emails,v 1.24 2010/10/31 02:25:05 jmc Exp $ # # The purpose of this script is to parse the emails produced by the # MITgcm/verificaton/testreport script and store the data in a @@ -211,7 +211,6 @@ continue fi tdir=`cat $TEMPDIR"/out" | head -1 | sed -e 's|^./||g' | cut -d '/' -f 1` - #tdir=`( cd $TEMPDIR ; /bin/ls -l | grep '^d' | head -1 | awk '{print $NF}' )` if test -d $TEMPDIR/$tdir ; then rm -f $TEMPDIR"/out" else @@ -257,16 +256,17 @@ #-- copy to $locDir and rename if necessary sdir=$tdir if test -e $locDir"/"$tdir ; then + sdir=`echo $tdir | sed 's/_[0-9]*$//'` ad=0 - while test -e $locDir"/"$tdir"_"$ad ; do + while test -e $locDir"/"$sdir"_"$ad ; do ad=$(( $ad + 1 )) done - sdir=$tdir"_"$ad + sdir=$sdir"_"$ad fi if test $PRT = 2 ; then if test "x$locDir" = "x$OUTDIR" - then echo " '$sdir'" - else echo " '$sdir' => '$locDir'" + then echo " '$sdir' ($file)" + else echo " '$sdir' ($file) => '$locDir'" fi fi mv $TEMPDIR"/"$tdir $locDir"/"$sdir > /dev/null 2>&1