|
[Sponsors] |
June 10, 2008, 08:30 |
Hello,
I would like to prop
|
#1 |
Senior Member
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22 |
Hello,
I would like to propose a small correction to the script wcleanMachine in order to correctly cleanup the Make directory under src/Pstream/mpi. With the actual current version of wcleanMachine, the clean-up is not made properly under src/Pstream/mpi/ because the script only looks for an exact machine pattern under the Make directory, which usually is $WM_OPTIONS. But under src/Pstream/mpi, we usually end up with directory names like this: Make/$(WM_OPTIONS)MPI or Make/$(WM_OPTIONS)LAM or Make/$(WM_OPTIONS)OPENMPI and wcleanMachine fails to remove those. So I would like to propose this little modification to the script wcleanMachine in order to handle this cleanup problem: # find `find . -depth \( -name "Make.[A-Za-z]*" -o -name "Make" \) -type d -print` -depth \( -type d -name "*$1" \) -exec rm -r { \; # <---- old version} find `find . -depth \( -name "Make.[A-Za-z]*" -o -name "Make" \) -type d -print` -depth \( -type d -regex ".*$1\|.*$1$WM_MPLIB" \) -exec rm -r { \;} Martin |
|
June 10, 2008, 11:21 |
Thanks for the suggestion, I h
|
#2 |
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 22 |
Thanks for the suggestion, I have put it in 1.5
Henry |
|
June 10, 2008, 14:05 |
Thanks Henry,
Please take n
|
#3 |
Senior Member
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22 |
Thanks Henry,
Please take note that I messed up the braces syntax of the last part of the find command while playing with the Forum Message formatting language. Here are the two lines again, but without any formatting: #find `find . -depth \( -name "Make.[A-Za-z]*" -o -name "Make" \) -type d -print` -depth \( -type d -name "*$1" \) -exec rm -r {} \; find `find . -depth \( -name "Make.[A-Za-z]*" -o -name "Make" \) -type d -print` -depth \( -type d -regex ".*$1\|.*$1$WM_MPLIB" \) -exec rm -r {} \; Sorry about that, and thanks to Bernhard for pointing that one out. Martin |
|
June 10, 2008, 15:18 |
Yes I noticed the error and co
|
#4 |
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 22 |
Yes I noticed the error and corrected it. I also changed the -regex to -name ... -o ... as I am not sur we can rely on all implementations of find support -regex.
H |
|
June 10, 2008, 16:38 |
Indeed, according to the man p
|
#5 |
Senior Member
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22 |
Indeed, according to the man page, "-name" and "-o" are specified in the POSIX standard, which should be more portable.
Thanks for the tip! Martin |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ICEM SCRIPT | bhaskar | CFX | 0 | January 3, 2009 05:49 |
Error in Tcl script | Haider | Fidelity CFD | 2 | October 5, 2007 02:44 |
awk script question | awk script question | Main CFD Forum | 0 | March 28, 2005 03:06 |
Kill Script | DAE | FLUENT | 3 | March 31, 2003 05:43 |
linking the script | Mavinakere | FLUENT | 0 | September 12, 2002 12:57 |