Commit 185d4175 authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: zero padding directly in cleanTimeDirectories

parent b62fe1ae
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
# CleanFunctions # CleanFunctions
# #
# Description # Description
# # Miscellaneous cleanup functions for tutorial cases
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#cleanTimeDirectories() #cleanTimeDirectories()
...@@ -46,15 +46,12 @@ ...@@ -46,15 +46,12 @@
cleanTimeDirectories() cleanTimeDirectories()
{ {
echo "Cleaning $PWD case" echo "Cleaning $PWD case"
nZeros=0
zeros="" zeros=""
while [ $nZeros -lt 8 ] while [ ${#zeros} -lt 8 ]
do do
timeDir="0.${zeros}[1-9]*" timeDir="0.${zeros}[1-9]*"
rm -rf ${timeDir} > /dev/null 2>&1 rm -rf ./${timeDir} ./-${timeDir} > /dev/null 2>&1
rm -rf ./-${timeDir} > /dev/null 2>&1 zeros="0$zeros"
zeros=`printf %0${nZeros}d 0`
nZeros=$(($nZeros + 1))
done done
rm -rf ./[1-9]* ./-[1-9]* ./log ./log.* ./log-* ./logSummary.* ./.fxLock ./*.xml ./ParaView* ./paraFoam* ./*.OpenFOAM > /dev/null 2>&1 rm -rf ./[1-9]* ./-[1-9]* ./log ./log.* ./log-* ./logSummary.* ./.fxLock ./*.xml ./ParaView* ./paraFoam* ./*.OpenFOAM > /dev/null 2>&1
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment