File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 3
3
# ========= |
4
4
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5
5
# \\ / O peration |
6
- # \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
6
+ # \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
7
7
# \\/ M anipulation |
8
8
# -------------------------------------------------------------------------------
9
9
# License
@@ -48,6 +48,7 @@ Searches the <directory> for files named <filename> and extracts entries with
48
48
Examples:
49
49
* Default ddtSchemes entries in the fvSchemes files in all tutorials:
50
50
foamSearch $FOAM_TUTORIALS fvSchemes ddtSchemes.default
51
+
51
52
* Relaxations factors for U in fvSolutions files in all tutorials:
52
53
foamSearch -c $FOAM_TUTORIALS fvSolution relaxationFactors.equations.U
53
54
USAGE
75
76
[ " $# " -eq 3 ] || error " Wrong number of arguments: expected 3, found $# "
76
77
[ -d " $1 " ] || error " $1 is not a directory"
77
78
78
- tmp=$( mktemp tmp.XXXXXX)
79
79
files=$( find " $1 " -name " $2 " )
80
80
[ -n " $files " ] || error " No file $2 found in $1 "
81
81
82
82
for f in $files
83
83
do
84
- foamDictionary -entry " $3 " " $f " 2> /dev/null >> " $tmp "
85
- done
86
-
87
- [ -s " $tmp " ] && \
88
- sort " $tmp " | uniq $count | sed ' /^[\t 1-9]*$/d' || \
84
+ foamDictionary -entry " $3 " " $f " 2> /dev/null
85
+ done | \
86
+ sort | uniq $count | sed ' /^[\t 1-9]*$/d' || \
89
87
echo " No keyword $3 found in $2 files"
90
88
91
- rm " $tmp " 2> /dev/null
92
-
93
89
# ------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments