From 60c81effb74fd1f679b6b27890384d3d26505ce0 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Fri, 15 Oct 2010 16:24:39 +0100
Subject: [PATCH] BUG: CleanFunctions using bash functionality

---
 bin/tools/CleanFunctions | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/bin/tools/CleanFunctions b/bin/tools/CleanFunctions
index 3256ff4ba65..1ada431b205 100644
--- a/bin/tools/CleanFunctions
+++ b/bin/tools/CleanFunctions
@@ -56,7 +56,7 @@ cleanTimeDirectories()
         zeros=`printf %0${nZeros}d 0`
         nZeros=$(($nZeros + 1))
     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
 }
 
 cleanCase()
@@ -65,16 +65,20 @@ cleanCase()
     rm -rf processor* > /dev/null 2>&1
     rm -rf probes* > /dev/null 2>&1
     rm -rf forces* > /dev/null 2>&1
-
-    rm -rf system/machines \
-           constant/polyMesh/{allOwner*,cell*,face*,meshModifiers*} \
-           constant/polyMesh/{owner*,neighbour*,point*,edge*} \
-           constant/polyMesh/{cellLevel*,pointLevel*,refinementHistory*,surfaceIndex*} \
-           constant/{cellToRegion,cellLevel*,pointLevel*} \
-           constant/polyMesh/sets/ \
-           VTK \
-           sets/streamLines \
-           > /dev/null 2>&1
+    rm -rf system/machines > /dev/null 2>&1
+    (cd constant/polyMesh && \
+        rm -rf \
+        allOwner* cell* face* meshModifiers* \
+        owner* neighbour* point* edge* \
+        cellLevel* pointLevel* refinementHistory* surfaceIndex* sets \
+        > /dev/null 2>&1 \
+    )
+    (cd constant && \
+        rm -rf \
+        cellToRegion cellLevel* pointLevel* \
+        > /dev/null 2>&1 \
+    )
+    rm -rf VTK > /dev/null 2>&1
 
     if [ -e constant/polyMesh/blockMeshDict.m4 ]
     then
@@ -96,12 +100,12 @@ removeCase()
 
 cleanSamples()
 {
-    rm -rf {sets,samples,sampleSurfaces} > /dev/null 2>&1
+    rm -rf ./sets ./samples ./sampleSurfaces > /dev/null 2>&1
 }
 
 cleanUcomponents()
 {
-    rm -rf 0/{Ux,Uy,Uz} > /dev/null 2>&1
+    rm -rf 0/Ux 0/Uy 0/Uz > /dev/null 2>&1
 }
 
 cleanApplication()
-- 
GitLab