Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
32292113
Commit
32292113
authored
14 years ago
by
Mark Olesen
Browse files
Options
Downloads
Patches
Plain Diff
ENH: catch empty wildcards in foamCleanPath
- also split on colons for consistency
parent
7f7cbddd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/foamCleanPath
+14
-7
14 additions, 7 deletions
bin/foamCleanPath
with
14 additions
and
7 deletions
bin/foamCleanPath
+
14
−
7
View file @
32292113
...
...
@@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2004-201
0
OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2004-201
1
OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
...
...
@@ -34,9 +34,11 @@
# - elements whose start matches a wildcard
# - inaccessible directories (with the -strip (at your option)
#
# Note:
# - this routine will fail when directories have embedded spaces
# - false matches possible if a wildcard contains '.' (sed regex)
# Note
# - this routine will fail when directories have embedded spaces
# - false matches possible if a wildcard contains '.' (sed regex)
# - the wildcards can themselves can be written together and separated
# by colons or whitespace
#------------------------------------------------------------------------------
usage
()
{
cat
<<
USAGE
1>&2
...
...
@@ -81,11 +83,12 @@ shift
##DEBUG echo "input>$dirList<" 1>&2
# preserve current IFS and split on whitespace
# preserve current IFS and split on
colon or
whitespace
oldIFS
=
"
$IFS
"
IFS
=
' '
IFS
=
'
:
'
# "wildcard1 ... wildcardN" may have been passed as a single parameter
# or may contain ':' separators
set
--
$*
# strip out wildcards via sed
...
...
@@ -94,7 +97,11 @@ do
wildcard
=
$1
shift
##DEBUG echo "remove>$wildcard<" 1>&2
dirList
=
$(
echo
"
$dirList
"
|
sed
-e
"s@
${
wildcard
}
[^:]*:@@g"
)
if
[
-n
"
$wildcard
"
]
then
dirList
=
$(
echo
"
$dirList
"
|
sed
-e
"s@
${
wildcard
}
[^:]*:@@g"
)
fi
done
# split on ':' (and on space as well to avoid any surprises)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment