--- mitgcm.org/front_content/parse_emails 2003/12/06 20:06:58 1.1 +++ mitgcm.org/front_content/parse_emails 2006/10/12 01:51:09 1.7 @@ -1,6 +1,6 @@ #! /usr/bin/env bash -# $Header: /home/ubuntu/mnt/e9_copy/mitgcm.org/front_content/parse_emails,v 1.1 2003/12/06 20:06:58 edhill Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/mitgcm.org/front_content/parse_emails,v 1.7 2006/10/12 01:51:09 edhill Exp $ # # The purpose of this script is to parse the emails produced by the # MITgcm/verificaton/testreport script and store the data in a @@ -28,7 +28,7 @@ INDIR="/u/edhill/Mail/MITgcm-test" OUTDIR= TEMPDIR=./ptmp -MUNPACK=munpack +MUNPACK=/u/edhill/local/bin/munpack # Parse options ac_prev= @@ -94,7 +94,7 @@ for file in $all_files ; do # create local copy - rm -rf $TEMPDIR + test -e $TEMPDIR && rm -rf $TEMPDIR mkdir $TEMPDIR cp $INDIR"/"$file $TEMPDIR @@ -118,7 +118,7 @@ if test "x$RETVAL" != x0 ; then continue fi - tdir=`cat $TEMPDIR"/out" | head -1 | cut -d '/' -f 1` + tdir=`cat $TEMPDIR"/out" | head -1 | sed -e 's|^./||g' | cut -d '/' -f 1` rm -f $TEMPDIR"/out" # copy to $OUTDIR and rename if necessary @@ -127,13 +127,12 @@ while test -e $OUTDIR"/"$tdir"_"$ad ; do ad=$(( $ad + 1 )) done - mv $TEMPDIR"/"$tdir $OUTDIR"/"$tdir"_"$ad + mv $TEMPDIR"/"$tdir $OUTDIR"/"$tdir"_"$ad > /dev/null 2>&1 + chmod -R a+rx $OUTDIR"/"$tdir"_"$ad > /dev/null 2>&1 + gzip $OUTDIR"/"$tdir"_"$ad"/output.txt" else - mv $TEMPDIR"/"$tdir $OUTDIR - fi - - # If it exists, gzip the "output.txt" file. - if test -r $OUTDIR"/"$tdir"/output.txt" ; then + mv $TEMPDIR"/"$tdir $OUTDIR > /dev/null 2>&1 + chmod -R a+rx $OUTDIR"/"$tdir > /dev/null 2>&1 gzip $OUTDIR"/"$tdir"/output.txt" fi @@ -143,18 +142,18 @@ done echo " done" -echo -n "gzipping all the \"output.txt\" files ..." -( - cd $OUTDIR - outp=`find . -name output.txt` - if test "x$outp" != x ; then - gzip $outp - fi -) -echo " done" - -echo -n "setting permissions to world-readable ..." -chmod -R a+rx $OUTDIR -echo " done" +# echo -n "gzipping all the \"output.txt\" files ..." +# ( +# cd $OUTDIR +# outp=`find . -name output.txt` +# if test "x$outp" != x ; then +# gzip $outp +# fi +# ) +# echo " done" + +# echo -n "setting permissions to world-readable ..." +# chmod -R a+rx $OUTDIR > /dev/null 2>&1 +# echo " done"