| 28 |
INDIR="/u/edhill/Mail/MITgcm-test" |
INDIR="/u/edhill/Mail/MITgcm-test" |
| 29 |
OUTDIR= |
OUTDIR= |
| 30 |
TEMPDIR=./ptmp |
TEMPDIR=./ptmp |
| 31 |
MUNPACK=munpack |
MUNPACK=/usr/local/bin/munpack |
| 32 |
|
|
| 33 |
# Parse options |
# Parse options |
| 34 |
ac_prev= |
ac_prev= |
| 94 |
for file in $all_files ; do |
for file in $all_files ; do |
| 95 |
|
|
| 96 |
# create local copy |
# create local copy |
| 97 |
rm -rf $TEMPDIR |
test -e $TEMPDIR && rm -rf $TEMPDIR |
| 98 |
mkdir $TEMPDIR |
mkdir $TEMPDIR |
| 99 |
cp $INDIR"/"$file $TEMPDIR |
cp $INDIR"/"$file $TEMPDIR |
| 100 |
|
|
| 118 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
| 119 |
continue |
continue |
| 120 |
fi |
fi |
| 121 |
tdir=`cat $TEMPDIR"/out" | head -1 | cut -d '/' -f 1` |
tdir=`cat $TEMPDIR"/out" | head -1 | sed -e 's|^./||g' | cut -d '/' -f 1` |
| 122 |
rm -f $TEMPDIR"/out" |
rm -f $TEMPDIR"/out" |
| 123 |
|
|
| 124 |
# copy to $OUTDIR and rename if necessary |
# copy to $OUTDIR and rename if necessary |
| 127 |
while test -e $OUTDIR"/"$tdir"_"$ad ; do |
while test -e $OUTDIR"/"$tdir"_"$ad ; do |
| 128 |
ad=$(( $ad + 1 )) |
ad=$(( $ad + 1 )) |
| 129 |
done |
done |
| 130 |
mv $TEMPDIR"/"$tdir $OUTDIR"/"$tdir"_"$ad |
mv $TEMPDIR"/"$tdir $OUTDIR"/"$tdir"_"$ad > /dev/null 2>&1 |
| 131 |
|
chmod -R a+rx $OUTDIR"/"$tdir"_"$ad > /dev/null 2>&1 |
| 132 |
|
gzip $OUTDIR"/"$tdir"_"$ad"/output.txt" |
| 133 |
else |
else |
| 134 |
mv $TEMPDIR"/"$tdir $OUTDIR |
mv $TEMPDIR"/"$tdir $OUTDIR > /dev/null 2>&1 |
| 135 |
fi |
chmod -R a+rx $OUTDIR"/"$tdir > /dev/null 2>&1 |
|
|
|
|
# If it exists, gzip the "output.txt" file. |
|
|
if test -r $OUTDIR"/"$tdir"/output.txt" ; then |
|
| 136 |
gzip $OUTDIR"/"$tdir"/output.txt" |
gzip $OUTDIR"/"$tdir"/output.txt" |
| 137 |
fi |
fi |
| 138 |
|
|
| 142 |
done |
done |
| 143 |
echo " done" |
echo " done" |
| 144 |
|
|
| 145 |
echo -n "gzipping all the \"output.txt\" files ..." |
# echo -n "gzipping all the \"output.txt\" files ..." |
| 146 |
( |
# ( |
| 147 |
cd $OUTDIR |
# cd $OUTDIR |
| 148 |
outp=`find . -name output.txt` |
# outp=`find . -name output.txt` |
| 149 |
if test "x$outp" != x ; then |
# if test "x$outp" != x ; then |
| 150 |
gzip $outp |
# gzip $outp |
| 151 |
fi |
# fi |
| 152 |
) |
# ) |
| 153 |
echo " done" |
# echo " done" |
| 154 |
|
|
| 155 |
echo -n "setting permissions to world-readable ..." |
# echo -n "setting permissions to world-readable ..." |
| 156 |
chmod -R a+rx $OUTDIR |
# chmod -R a+rx $OUTDIR > /dev/null 2>&1 |
| 157 |
echo " done" |
# echo " done" |
| 158 |
|
|
| 159 |
|
|