diff --git a/bin/tools/inlineReplace b/bin/tools/inlineReplace deleted file mode 100755 index 27d19f8164..0000000000 --- a/bin/tools/inlineReplace +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# $0 oldString newString file1 .. fileN -# -if [ $# -lt 3 ] -then - echo "Usage: ${0##*/} [.. fileN]" - echo "" - echo "Replaces all occurrences of oldString by newString in files." - echo "(replacement for sed -i on systems that don't support it)" - exit 1 -fi - -oldString="$1" -newString="$2" -shift 2 - -for f -do - if grep "$oldString" "$f" >/dev/null - then - cp "$f" "${f}_bak" - sed -e "s@$oldString@$newString@g" "${f}_bak" > "$f" - rm -f "${f}_bak" - #else - # echo "String $oldString not present in $f" - fi -done - -# ----------------------------------------------------------------- end-of-file diff --git a/bin/tools/pre-commit-hook b/bin/tools/pre-commit-hook index 2905d7d322..d3bf374e04 100755 --- a/bin/tools/pre-commit-hook +++ b/bin/tools/pre-commit-hook @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -290,7 +290,7 @@ checkCopyright() then echo "Updated copyright for: $f" 1>&2 echo "$f" - sed -i "s/$startYear-$endYear OpenFOAM/$startYear-$year OpenFOAM/g" $f + sed -i -e "s/$startYear-$endYear OpenFOAM/$startYear-$year OpenFOAM/g" $f fi else # Date is of type 2011 OpenFOAM Foundation @@ -298,7 +298,7 @@ checkCopyright() then echo "$f" echo "Updated copyright for: $f" 1>&2 - sed -i "s/$startYear OpenFOAM/$startYear-$year OpenFOAM/g" $f + sed -i -e "s/$startYear OpenFOAM/$startYear-$year OpenFOAM/g" $f fi fi fi diff --git a/bin/tools/replaceAllShellSun b/bin/tools/replaceAllShellSun deleted file mode 100755 index d5a0d8db99..0000000000 --- a/bin/tools/replaceAllShellSun +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/xpg4/bin/sh - -# Replace all shell script headers with -if [ $# -ne 1 -o ! -d "$1" ] -then - echo "Usage: ${0##*/} " - 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 - -# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/Allrun b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/Allrun index dd782a7196..0df7881d40 100755 --- a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/Allrun +++ b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/Allrun @@ -9,7 +9,7 @@ application=`getApplication` runApplication star3ToFoam prostar/nacaAirfoil -sed -i 's/symmetry\([)]*;\)/empty\1/' constant/polyMesh/boundary +sed -i -e 's/symmetry\([)]*;\)/empty\1/' constant/polyMesh/boundary runApplication $application diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/Allrun.pre b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/Allrun.pre index 019978bbb4..06e9e9ec5f 100755 --- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/Allrun.pre +++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/Allrun.pre @@ -30,7 +30,7 @@ rm -rf system/wallFilmRegion cp -r system/wallFilmRegion.org system/wallFilmRegion find ./0 -maxdepth 1 -type f -exec \ - sed -i "s/wallFilm/\"(region0_to.*)\"/g" {} \; + sed -i -e "s/wallFilm/\"(region0_to.*)\"/g" {} \; paraFoam -touch paraFoam -touch -region wallFilmRegion diff --git a/wmake/MakefileFiles b/wmake/MakefileFiles index 9f0ed1cf9d..8c5535354a 100644 --- a/wmake/MakefileFiles +++ b/wmake/MakefileFiles @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -68,16 +68,9 @@ $(SFILES): $(MAKE_DIR)/files # Add a newline to files to ensure the last line is followed by a newline @echo "" >> $(SFILES) # Remove commented lines, blank lines, and trailing blanks from files - @sed -i \ - -e '/^#/ d' \ - -e '/^[ \t]*$$/ d' \ - -e 's,[ \t]*$$,,' \ - $(SFILES) + @sed -i -e '/^#/ d' -e '/^[ \t]*$$/ d' -e 's,[ \t]*$$,,' $(SFILES) # Add backslashes - @sed -i \ - -e 's,$$, \\,' \ - -e '$$s,\\,,' \ - $(SFILES) + @sed -i -e 's,$$, \\,' -e '$$s,\\,,' $(SFILES) $(VARS): $(SFILES)