scripts: Replaced 'cp -r' with the POSIX compliant 'cp -R'

This commit is contained in:
Henry Weller
2021-07-06 17:41:08 +01:00
parent 013bc08399
commit 6b2dfd218a
13 changed files with 21 additions and 21 deletions

View File

@ -39,7 +39,7 @@ Description
mkdir processorN mkdir processorN
# Copy undecomposed polyMesh # Copy undecomposed polyMesh
cp -r constant processor0 cp -R constant processor0
# Distribute # Distribute
mpirun -np ddd redistributePar -parallel mpirun -np ddd redistributePar -parallel

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org # \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -63,7 +63,7 @@ error() {
} }
cpIfPresent() { cpIfPresent() {
[ -e "$1" ] && echo "$1 to ... ${1##*/}" && cp -r "$1" "$2" [ -e "$1" ] && echo "$1 to ... ${1##*/}" && cp -R "$1" "$2"
} }
isCaseValid() { isCaseValid() {

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org # \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -220,7 +220,7 @@ do
esac esac
done done
echo "Creating Make subdirectory" && cp -r "${dir}/Make" "${name}" echo "Creating Make subdirectory" && cp -R "${dir}/Make" "${name}"
# Get ...Fields.C for template class, otherwise ...Field.C # Get ...Fields.C for template class, otherwise ...Field.C
compiled=$(find "${name}" -name "*.C" -exec basename {} \; | sort | tail -1) compiled=$(find "${name}" -name "*.C" -exec basename {} \; | sort | tail -1)

View File

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org # \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -170,7 +170,7 @@ cloneCase()
mkdir -p $to mkdir -p $to
for f in 0 system constant for f in 0 system constant
do do
cp -r $from/$f $to cp -R $from/$f $to
done done
return 0 return 0
fi fi

View File

@ -22,15 +22,15 @@ runParallel -s uncollated $application -fileHandler uncollated
rm -rf machineA/fileHandler rm -rf machineA/fileHandler
mkdir -p machineA/fileHandler mkdir -p machineA/fileHandler
( cd machineA/fileHandler && \ ( cd machineA/fileHandler && \
cp -r ../../processor[0-1] . && \ cp -R ../../processor[0-1] . && \
cp -r ../../system . && \ cp -R ../../system . && \
mkdir -p constant && find ../../constant -type f -exec cp {} constant/ \; mkdir -p constant && find ../../constant -type f -exec cp {} constant/ \;
) )
#- Note: slave node does not need constant&system since these are global #- Note: slave node does not need constant&system since these are global
rm -rf machineB/fileHandler rm -rf machineB/fileHandler
mkdir -p machineB/fileHandler mkdir -p machineB/fileHandler
( cd machineB/fileHandler && \ ( cd machineB/fileHandler && \
cp -r ../../processor[2-3] . cp -R ../../processor[2-3] .
) )
#- Run with different roots #- Run with different roots
( d=$PWD && \ ( d=$PWD && \
@ -77,8 +77,8 @@ runApplication -s collated decomposePar \
rm -rf machineA/fileHandler rm -rf machineA/fileHandler
mkdir -p machineA/fileHandler mkdir -p machineA/fileHandler
( cd machineA/fileHandler && \ ( cd machineA/fileHandler && \
cp -r ../../processor* . && \ cp -R ../../processor* . && \
cp -r ../../system . && \ cp -R ../../system . && \
mkdir -p constant && find ../../constant -type f -exec cp {} constant/ \; mkdir -p constant && find ../../constant -type f -exec cp {} constant/ \;
) )
#- Note: slave node does not need constant&system since these are global #- Note: slave node does not need constant&system since these are global

View File

@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory
./Allmesh ./Allmesh
cp -rf 0.orig 0 cp -Rf 0.orig 0
application=$(getApplication) application=$(getApplication)

View File

@ -6,7 +6,7 @@ application=$(getApplication)
runApplication blockMesh runApplication blockMesh
cp -r 0.orig 0 cp -R 0.orig 0
# Create 1D and 3D baffles # Create 1D and 3D baffles
runApplication createBaffles -overwrite runApplication createBaffles -overwrite

View File

@ -21,7 +21,7 @@ runMapFieldsConsistent()
copySolutionDirs() copySolutionDirs()
{ {
echo "Copying $2/0* directory to $1" echo "Copying $2/0* directory to $1"
cp -r $2/0* $1 cp -R $2/0* $1
} }
setCavityFine() setCavityFine()
@ -77,7 +77,7 @@ do
runMapFieldsConsistent $previousCase $caseName runMapFieldsConsistent $previousCase $caseName
;; ;;
cavityClipped) cavityClipped)
cp -r $caseName/0 $caseName/0.5 cp -R $caseName/0 $caseName/0.5
runMapFields cavity $caseName runMapFields cavity $caseName
;; ;;
esac esac

View File

@ -11,7 +11,7 @@ runApplication blockMesh
# Create faceZones for baffles and fan # Create faceZones for baffles and fan
runApplication topoSet runApplication topoSet
cp -r 0.orig 0 cp -R 0.orig 0
# Create wall and cyclic baffles and the fields on them # Create wall and cyclic baffles and the fields on them
runApplication createBaffles -overwrite runApplication createBaffles -overwrite

View File

@ -18,7 +18,7 @@ runApplication simpleFoam
# Copy the mesh from the steady state case and map the results to a # Copy the mesh from the steady state case and map the results to a
# mesh motion case, then solve transient. # mesh motion case, then solve transient.
cd ../wingMotion2D_pimpleFoam cd ../wingMotion2D_pimpleFoam
cp -r ../wingMotion2D_simpleFoam/constant/polyMesh constant cp -R ../wingMotion2D_simpleFoam/constant/polyMesh constant
runApplication mapFields ../wingMotion2D_simpleFoam -sourceTime latestTime -consistent runApplication mapFields ../wingMotion2D_simpleFoam -sourceTime latestTime -consistent
cp pointDisplacement 0/pointDisplacement cp pointDisplacement 0/pointDisplacement
runApplication decomposePar runApplication decomposePar

View File

@ -16,7 +16,7 @@ cloneParallelCase()
cpfiles="processor* system constant" cpfiles="processor* system constant"
for f in $cpfiles for f in $cpfiles
do do
cp -r $1/$f $2 cp -R $1/$f $2
done done
fi fi
} }

View File

@ -13,7 +13,7 @@ cd ..
cd hopperEmptying cd hopperEmptying
rm -rf 0 rm -rf 0
cp -r 0.orig 0 cp -R 0.orig 0
runApplication blockMesh runApplication blockMesh
runApplication mapFields ../hopperInitialState -sourceTime latestTime runApplication mapFields ../hopperInitialState -sourceTime latestTime
runApplication decomposePar runApplication decomposePar

View File

@ -18,7 +18,7 @@ runApplication -s selectBottom \
runApplication createPatch -overwrite runApplication createPatch -overwrite
cp -r 0.orig 0 > /dev/null 2>&1 cp -R 0.orig 0 > /dev/null 2>&1
runApplication $application runApplication $application