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
76dd475a
Commit
76dd475a
authored
16 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
sun porting
parent
94bec509
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/tools/inlineReplace
+28
-0
28 additions, 0 deletions
bin/tools/inlineReplace
bin/tools/replaceAllShellSun
+15
-0
15 additions, 0 deletions
bin/tools/replaceAllShellSun
with
43 additions
and
0 deletions
bin/tools/inlineReplace
0 → 100755
+
28
−
0
View file @
76dd475a
#!/bin/sh
# $0 string1 string2 file1 .. filen
#
if
[
$#
-lt
3
]
;
then
echo
"Usage:
`
basename
$0
`
[-f] <string1> <string2> <file1> .. <filen>"
echo
""
echo
"Replaces all occurrences of string1 by string2 in files."
echo
"(replacement of sed -i on those systems that don't support it)"
exit
1
fi
FROMSTRING
=
$1
shift
TOSTRING
=
$1
shift
for
f
in
$*
do
if
grep
"
$FROMSTRING
"
"
$f
"
>
/dev/null
then
cp
"
$f
"
"
${
f
}
_bak"
sed
-e
"s@
$FROMSTRING
@
$TOSTRING
@g"
"
${
f
}
"
_bak
>
"
$f
"
rm
-f
"
${
f
}
"
_bak
#else
# echo "String $FROMSTRING not present in $f"
#fi
done
This diff is collapsed.
Click to expand it.
bin/tools/replaceAllShellSun
0 → 100755
+
15
−
0
View file @
76dd475a
#!/usr/xpg4/bin/sh
# Replace all shell script headers with
if
[
$#
-ne
1
-o
!
-d
"
$1
"
]
;
then
echo
"Usage:
`
basename
$0
`
<dir>"
echo
""
echo
"Replaces all occurrences of #!/bin/sh with #!/usr/xpg4/bin/sh inside a directory tree."
exit
1
fi
#- note that below does not work since {} does not get replaced
#find $1 -type f -exec /usr/xpg4/bin/sh -c "grep '^#\!/bin/sh' {} >/dev/null && echo {} && mv {} {}_bak && sed -e 's@^#\!/bin/sh@#\!/usr/xpg4/bin/sh@' {}_bak > {}" ';'
find
$1
-exec
$WM_PROJECT_DIR
/bin/tools/inlineReplace
'^#\!/bin/sh'
'#\!/usr/xpg4/bin/sh'
{}
\;
-print
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